Commit cfd9081b 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 d465e4ac
...@@ -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.
- Launchpad ##332168: Connection.py: do not expose DB connection strings - Launchpad ##332168: Connection.py: do not expose DB connection strings
through exceptions through exceptions
......
############################################################################## ##############################################################################
# #
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved. # Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
...@@ -478,6 +479,8 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -478,6 +479,8 @@ 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
......
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