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
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
through exceptions
......
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
......@@ -478,7 +479,9 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
if r is not None:
r, u = r
w, rs = weightedIntersection(rs, r)
if not rs:
break
if rs is None:
# None of the indexes found anything to do with the request
# 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