[Checkins] SVN: Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py Don't use a sort limit greater or equal to the resultset

Hanno Schlichting hannosch at hannosch.eu
Wed Jan 26 16:41:18 EST 2011


Log message for revision 119952:
  Don't use a sort limit greater or equal to the resultset
  

Changed:
  U   Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py

-=-
Modified: Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2011-01-26 21:32:13 UTC (rev 119951)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2011-01-26 21:41:18 UTC (rev 119952)
@@ -683,6 +683,10 @@
         else:
             rlen = actual_result_count
 
+        # don't limit to more than what we have
+        if limit is not None and limit >= rlen:
+            limit = rlen
+
         if merge and limit is None and (
             rlen > (len(sort_index) * (rlen / 100 + 1))):
             # The result set is much larger than the sorted index,



More information about the checkins mailing list