[Zope] Catalog Searching
Toby Dickenson
tdickenson@geminidataloggers.com
Thu, 21 Sep 2000 10:42:34 +0100
On Wed, 20 Sep 2000 14:51:01 +0100, Chris Withers <chrisw@nipltd.com>
wrote:
>Maik Roeder wrote:
>> <dtml-in "Catalog()" reverse sort=bobobase_modification_time size=50>
>> Show stuff in Catalog here.
>> </dtml-with>
>
>That doesn't take advantage of the Catalog's lazy searching, AFAIK, and
>on a site with a lot of content that could be bad.
Lazy searching is not an issue - that definitely happens. The catalog
always uses its cached metadata for searching and sorting.
A more interesting question is over sorting-by-index. Whether or not
this happens depends on the relative size of two sets:
a. The number of *different* *values* for the sort attribute over the
whole catalog content.
b. The number of matches found.
If number(b)>number(a) then sorting-by-index works well. This might
happen for example if you are sorting by "author name", where there
are more matches than there are authors. This is efficient since the
catalog precomputes the matches grouped by author name, and it only
needs to sort the groups.
If number(a)<number(b) then there is no sorting-by-index. In this case
there are more groups than matches (ie many groups are empty) and it
is more efficient to sort matches. This is probably the case for an
index of bobobase_modification_time
Toby Dickenson
tdickenson@geminidataloggers.com