Arrange to cache the results of looking up a btree predicate proof comparison
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 13 Nov 2008 00:20:45 +0000 (00:20 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 13 Nov 2008 00:20:45 +0000 (00:20 +0000)
commit6eb40ee12c98171555aed02204dfcf18041065b9
tree1b53f510cea53646a87ffe8c2e8b6a6cfc9ce364
parent70f36d1eaf300e1ccd2e80880403600c1c1c16ba
Arrange to cache the results of looking up a btree predicate proof comparison
operator.  The result depends only on the two input operators and the proof
direction (imply or refute), so it's easy to cache.  This provides a very
large savings in cases such as Sergey Konoplev's long NOT-IN-list example,
where predtest spends all its time repeatedly figuring out that the same pair
of operators cannot be used to prove anything.  (But of course the O(N^2)
behavior still catches up with you eventually.)  I'm not convinced it buys
a whole lot when constraint_exclusion isn't turned on, but it's not a lot
of added code so we might as well cache all the time.
src/backend/optimizer/util/predtest.c