Re: [GENERAL] Creation of tsearch2 index is very slow

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [GENERAL] Creation of tsearch2 index is very slow
Дата
Msg-id 20060120213754.GG31908@svana.org
обсуждение исходный текст
Ответ на Re: [GENERAL] Creation of tsearch2 index is very slow  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [GENERAL] Creation of tsearch2 index is very slow  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
Re: [GENERAL] Creation of tsearch2 index is very slow  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [GENERAL] Creation of tsearch2 index is very slow  (Ron <rjpeace@earthlink.net>)
Список pgsql-performance
On Fri, Jan 20, 2006 at 04:19:15PM -0500, Tom Lane wrote:
>   %   cumulative   self              self     total
>  time   seconds   seconds    calls  Ks/call  Ks/call  name
>  98.96   1495.93  1495.93 33035195     0.00     0.00  hemdistsign

<snip>

> So we gotta fix hemdistsign ...

lol! Yeah, I guess so. Pretty nasty loop. LOOPBIT will iterate 8*63=504
times and it's going to do silly bit handling on each and every
iteration.

Given that all it's doing is counting bits, a simple fix would be to
loop over bytes, use XOR and count ones. For extreme speedup create a
lookup table with 256 entries to give you the answer straight away...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: [PERFORMANCE] Stored Procedures
Следующее
От: "Steinar H. Gunderson"
Дата:
Сообщение: Re: [GENERAL] Creation of tsearch2 index is very slow