Fix an old error in clause_selectivity: the default selectivity estimate
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 11 Jan 2008 17:00:45 +0000 (17:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 11 Jan 2008 17:00:45 +0000 (17:00 +0000)
commit3b66b2ee29e44cf3665e66015d4ad6e763fd8316
tree6a1e10e56fcf36b2838317c44e85da6c2b2b0f24
parent05326916c249c4e82e101828877edf45cf75085b
Fix an old error in clause_selectivity: the default selectivity estimate
for unhandled clause types ought to be 0.5, not 1.0.  I fear I introduced
this silliness due to misreading the intent of the very-poorly-structured
code that was there when we inherited the file from Berkeley.  The lack
of sanity in this behavior was exposed by an example from Sim Zacks.
(Arguably this is a bug fix and should be back-patched, but I'm a bit
hesitant to introduce a possible planner behavior change in the back
branches; it might detune queries that worked acceptably in the past.)

While at it, make estimation for DistinctExpr do something marginally
realistic, rather than just defaulting.
src/backend/optimizer/path/clausesel.c