Skip to content

Commit

Permalink
Remove the consideration of a sort_limit when deciding on a the sort …
Browse files Browse the repository at this point in the history
…index scan. If the sort index is a lot smaller than the result set, N-Best/N-Worst algorithms won't do any better
  • Loading branch information
hannosch committed Apr 7, 2012
1 parent 72cd42f commit b4b4930
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Products/ZCatalog/Catalog.py
Expand Up @@ -729,11 +729,9 @@ def sortResults(self, rs, sort_index, reverse=False, limit=None,
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(()))
Expand Down

0 comments on commit b4b4930

Please sign in to comment.