Re: Key/Value reference table generation: INSERT/UPDATE performance
В списке pgsql-performance по дате отправления:
| От | Guillaume Smet |
|---|---|
| Тема | Re: Key/Value reference table generation: INSERT/UPDATE performance |
| Дата | |
| Msg-id | 1d4e0c10705230104o30db1cf6x86207a96b23f823a@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Key/Value reference table generation: INSERT/UPDATE performance (cedric <cedric.villemain@dalibo.com>) |
| Список | pgsql-performance |
On 5/22/07, cedric <cedric.villemain@dalibo.com> wrote:
> I made something very similar, and using PL/pgsql is very slow, when using
> perl is very quick.
Another solution is to use tsearch2 for that:
CREATE TABLE word_counts AS SELECT * FROM stat('SELECT
to_tsvector(''simple'', lower(coalesce(field containing words, '''')))
FROM your table');
I don't know if the fact you have an array of words is a must have or
just a design choice. If you have to keep that, you can transform the
array easily into a string with array_to_string and use the same sort
of query.
I don't know what are exactly your speed requirements but it's quite
fast here. If you drop your table and recreate it into a transaction,
it should work like a charm (or you can use TRUNCATE and INSERT INTO).
--
Guillaume
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера