Commit 2b3bbd74 authored by Tres Seaver's avatar Tres Seaver

Launchpad #348223: optimize catalog query by breaking out early from loop

over indexes if the result set is already empty.
parent b1ccd16a
...@@ -27,6 +27,9 @@ Zope Changes ...@@ -27,6 +27,9 @@ Zope Changes
Bugs Fixed Bugs Fixed
- Launchpad #348223: optimize catalog query by breaking out early from
loop over indexes if the result set is already empty.
- "Permission tab": correct wrong form parameter for - "Permission tab": correct wrong form parameter for
the user-permission report the user-permission report
......
############################################################################## ##############################################################################
# #
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved. # Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
...@@ -478,7 +479,9 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -478,7 +479,9 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
if r is not None: if r is not None:
r, u = r r, u = r
w, rs = weightedIntersection(rs, r) w, rs = weightedIntersection(rs, r)
if not rs:
break
if rs is None: if rs is None:
# None of the indexes found anything to do with the request # None of the indexes found anything to do with the request
# We take this to mean that the query was empty (an empty filter) # We take this to mean that the query was empty (an empty filter)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment