[Zope] Re: Catalog reindexing: field by field or not?

Casey Duncan casey at zope.com
Fri Feb 20 11:46:19 EST 2004


On Fri, 20 Feb 2004 11:50:46 +0100
Lennart Regebro <lennart at regebro.nu> wrote:

> I notice that when calling manage_reindexIndex with several indexes,
> it will simply call reindexIndex once for each index.
> 
> The question is, is there a performace penalty for reindexing several 
> fields separately like this, or will it always be faster to only
> reindex the relevant indexes?

I'm not sure I understand the question. It will definitely be faster to
update fewer indexes. Calling it repeatedly with one index is probably
not much different than calling it with several at once AFAICT.

It looks to me like this could be optimized by only doing one pass
through the objects and calling catalog_object() with multiple indexes
instead of the current implementation which does one pass over all
objects per index.
 
> It seems to me that at some point it should be faster to just reindex 
> the whole catalog, since that just traverses through the objects
> once...

Perhaps, except that reindexing the whole catalog also updates metadata
whereas reindexing indexes individually does not. So it would depend how
much metadata you have.

> (This is Zope 2.6, btw, maybe it's changed in 2.7?)

This has not changed much from 2.6 to 2.7 that I know of.

-Casey




More information about the Zope mailing list