[Checkins] SVN: Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py Remove the consideration of a sort_limit when deciding on a the sort index scan. If the sort index is a lot smaller than the result set, N-Best/N-Worst algorithms won't do any better

Hano Schlichting cvs-admin at zope.org
Sat Apr 7 23:43:20 UTC 2012


Log message for revision 125094:
  Remove the consideration of a sort_limit when deciding on a the sort index scan. If the sort index is a lot smaller than the result set, N-Best/N-Worst algorithms won't do any better
  

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	2012-04-07 23:21:45 UTC (rev 125093)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2012-04-07 23:43:16 UTC (rev 125094)
@@ -729,11 +729,9 @@
                 sort_spec.append(reverse and -1 or 1)
             first_reverse = reverse
 
-        if merge and limit is None and (
-            rlen > (len(sort_index) * (rlen / 100 + 1))):
+        if merge and (rlen > (len(sort_index) * (rlen / 100 + 1))):
             # The result set is much larger than the sorted index,
             # so iterate over the sorted index for speed.
-            # This is rarely exercised in practice...
             length = 0
             try:
                 intersection(rs, IISet(()))



More information about the checkins mailing list