diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-01-30 12:30:41 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-01-30 12:31:08 -0500 |
commit | b6a164e5cb389a52b2187bbacdcdaab46e236418 (patch) | |
tree | ebfdf7c940b028b9dbab129ad739d1198d733ae0 /src/backend/tcop/postgres.c | |
parent | dc40ca696313ee8f7e75bb7628990e6e138b0e01 (diff) | |
download | postgresql-b6a164e5cb389a52b2187bbacdcdaab46e236418.tar.gz postgresql-b6a164e5cb389a52b2187bbacdcdaab46e236418.zip |
Fix assorted oversights in range selectivity estimation.
calc_rangesel() failed outright when comparing range variables to empty
constant ranges with < or >=, as a result of missing cases in a switch.
It also produced a bogus estimate for > comparison to an empty range.
On top of that, the >= and > cases were mislabeled throughout. For
nonempty constant ranges, they managed to produce the right answers
anyway as a result of counterbalancing typos.
Also, default_range_selectivity() omitted cases for elem <@ range,
range &< range, and range &> range, so that rather dubious defaults
were applied for these operators.
In passing, rearrange the code in rangesel() so that the elem <@ range
case is handled in a less opaque fashion.
Report and patch by Emre Hasegeli, some additional work by me
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions