[Checkins] SVN: Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py Explain the limit*4 case

Hano Schlichting cvs-admin at zope.org
Sun Apr 8 13:49:38 UTC 2012


Log message for revision 125103:
  Explain the limit*4 case
  

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-08 13:41:04 UTC (rev 125102)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2012-04-08 13:49:34 UTC (rev 125103)
@@ -783,7 +783,9 @@
                 b_size, switched_reverse)
             result = LazyCat(LazyValues(sequence), slen, actual_result_count)
         elif limit is None or (limit * 4 > rlen):
-            # Iterate over the result set getting sort keys from the index
+            # Iterate over the result set getting sort keys from the index.
+            # If we are interested in at least 25% or more of the result set,
+            # the N-Best algorithm is slower, so we iterate over all.
             if sort_index_length == 1:
                 for did in rs:
                     try:



More information about the checkins mailing list