Hi... I have a quite big ZCatalog, on which I have to make several queries including several indexes. Is there any way to optimize such queries (query parameters order, index types,...) ?? Thanks for any advise. Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
There are no real general optimizations to be made but here are some suggestions. One thing to consider would be to consolidate a query involving multiple indexes to a single FieldIndex by precomputing and combining the values of the other indexes together. The 2.6 TopicIndexes are a built-in facility for this, but you can just use a python script and a FieldIndex to approximate the same thing on earlier zopes. Of course that really only helps FieldIndexes, and maybe KeywordIndexes (depending on usage). Also, if you are using 2.6, there is a new DateRange index which is an optimization for searching for things falling between two dates. It should be much faster then search two FieldIndexes. 2.6 as has a DateIndex which is more efficient at indexing dates then a FieldIndex, it keys on a lower date resolution so the index should be smaller and faster to query. Another option would be to put some sort of caching in front of the Catalog to avoid repeating the same queries too often. In zope this might be done with a python script that performs the query bound to a RAM cache manager (this would be good if the query is shared by several pages or the pages themselves are uncachable) or just general caching on the pages displaying the queries using HTTP cache managers and squid or apache. hth, -Casey On Monday 04 November 2002 09:52 am, Thierry Florac wrote:
Hi...
I have a quite big ZCatalog, on which I have to make several queries including several indexes. Is there any way to optimize such queries (query parameters order, index types,...) ??
Thanks for any advise.
Thierry
-- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
Thierry Florac writes:
I have a quite big ZCatalog, on which I have to make several queries including several indexes. Is there any way to optimize such queries (query parameters order, index types,...) ?? Usually, you should ask the indexes which give rise to small result sets first, to keep the intermediate results small.
However, I fear, the current catalog searches indexes in a fixed order. You cannot determine it from the outside. Dieter
participants (3)
-
Casey Duncan -
Dieter Maurer -
Thierry Florac