[Zope-CMF] How to limit results in AdvancedQuery

Dieter Maurer dieter at handshake.de
Thu Sep 9 14:24:24 EDT 2004


Please do not post HTML mail.

Usually, I do not read them at all.
This time, I made an exception as the subjects indicated that it
concerns "AdvancedQuery". It is not sure that I make another exception.


Dinh Trung Viet wrote at 2004-9-9 14:23 +0700:
>Sometimes I want to limit results from a catalog query. But I can't find any way to do it with AdvancedQuery.

"AdvancedQuery" performs incremental sorting (when it is worth it).
Therefore, there is not need to limit sorting.

Just access as many elements as you need.

If the sort index is sufficiently small compared to the result set,
then AdvancedQuery does not sort more than necessary.

Otherwise, sorting time is by far outweighted by the lookup time
for the document sorting keys. Thus, limiting the sort has an
almost negligible effect.

-- 
Dieter


More information about the Zope-CMF mailing list