[Zope-dev] KeywordIndex performance / multiunion

Seb Bacon seb at jamkit.com
Fri Nov 7 07:02:07 EST 2003


Casey Duncan wrote:
> On Thu, 06 Nov 2003 19:11:55 +0000
> Seb Bacon <seb at jamkit.com> wrote:
>>A simple query for ["A" or "B" or "C"] against a KeywordIndex containing 
>>27k objects is taking about 7 seconds on a Celeron 1.6Ghz, which seems 
>>an absurdly long time to me.
> 
> <guess>
> This time may be caused by fetching from the database. If so, then the
 > only way to speed it up is increase the ZODB cache or get faster disks.
 > Try the former and see if it helps. </guess>

Yup, absolutely right.  Upping the cache speeds it up to something sane. 
  However, I don't understand why.  The code does something like:

  set1 = self.index.get(1)
  set2 = self.index.get(2)
  sets = [set1, set2]

...so the sets will have come from the ZODB.  But the bit which takes 
the time is the following line:

  result = multiunion(sets)

At which point the sets have already been fetched, no?

looking forward to the day I understand ZODB caches...;-)

seb






More information about the Zope-Dev mailing list