OSDN Git Service

Make a marginal performance improvement in predicate_implied_by and
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 May 2009 22:45:28 +0000 (22:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 May 2009 22:45:28 +0000 (22:45 +0000)
commit723476c72ef50c102635d4c9c6f9b43244e78f7d
tree29fc90f55086d04938c31e4934de216e23191aa1
parent4db44b433b857dc2a823eb4673d94346224df698
Make a marginal performance improvement in predicate_implied_by and
predicate_refuted_by: if either top-level input is a single-element list,
reduce it to its lone member before proceeding.  This avoids
a useless level of AND-recursion within the recursive proof routines.
It's worth doing because, for example, if the clause is a 100-element
list and the predicate is a 1-element list then we'd otherwise strip
the predicate's list structure 100 times as we iterate through the clause.
It's only needed at top level because there won't be any trivial ANDs below
that --- this situation is an artifact of the decision to represent even
single-item conditions as Lists in the "implicit AND" format, and that format
is only used at the top level of any predicate or restriction condition.
src/backend/optimizer/util/predtest.c