Skip site navigation (1) Skip section navigation (2)

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

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Vollmer <svollmer(at)gmx(dot)de>, pgsql-performance(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Creation of tsearch2 index is very slow
Date: 2006-01-20 21:37:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-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


> 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

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(at)svana(dot)org>
> 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.

In response to


pgsql-performance by date

Next:From: Jerry SieversDate: 2006-01-20 21:42:20
Subject: Sudden slowdown of Pg server
Previous:From: Jim C. NasbyDate: 2006-01-20 21:34:55
Subject: Re: [PERFORMANCE] Stored Procedures

pgsql-general by date

Next:From: Steinar H. GundersonDate: 2006-01-20 21:44:02
Subject: Re: [GENERAL] Creation of tsearch2 index is very slow
Previous:From: Bruce MomjianDate: 2006-01-20 21:36:56
Subject: Re: Page-Level Encryption

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group