postgresql/src/backend/utils/adt
Tom Lane 3d660d33aa 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
2015-01-30 12:30:59 -05:00
..
acl.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
array_selfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
array_typanalyze.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
array_userfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
arrayfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
arrayutils.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
ascii.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
bool.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
cash.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
char.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
date.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
datetime.c Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
datum.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
dbsize.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
domains.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
encode.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
enum.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
float.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
format_type.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
formatting.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
genfile.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
geo_ops.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
geo_selfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
inet_cidr_ntop.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
inet_net_pton.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
int8.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
int.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
json.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
jsonb_gin.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
jsonb_op.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
jsonb_util.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
jsonb.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
jsonfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
levenshtein.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
like_match.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
like.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
lockfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
mac.c Allow input format xxxx-xxxx-xxxx for macaddr type 2014-10-21 16:16:39 -04:00
Makefile Temporarily revert "Move pg_lzcompress.c to src/common." 2014-12-25 13:22:55 -05:00
misc.c Add a default local latch for use in signal handlers. 2015-01-14 18:45:22 +01:00
nabstime.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
name.c Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
network_gist.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
network_selfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
network.c Add min and max aggregates for inet/cidr data types. 2014-08-28 22:37:58 -04:00
numeric.c Fix NUMERIC field access macros to treat NaNs consistently. 2015-01-27 12:06:31 -05:00
numutils.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
oid.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
oracle_compat.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
orderedsetaggs.c Use abbreviated keys for faster sorting of text datums. 2015-01-19 15:28:27 -05:00
pg_locale.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_lsn.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
pg_lzcompress.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
pgstatfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
pseudotypes.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
quote.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
rangetypes_gist.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
rangetypes_selfuncs.c Fix assorted oversights in range selectivity estimation. 2015-01-30 12:30:59 -05:00
rangetypes_spgist.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
rangetypes_typanalyze.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
rangetypes.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
regexp.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
regproc.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
ri_triggers.c Fix column-privilege leak in error-message paths 2015-01-28 12:31:30 -05:00
rowtypes.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
ruleutils.c Improve performance of EXPLAIN with large range tables. 2015-01-15 13:18:12 -05:00
selfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tid.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
timestamp.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
trigfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsginidx.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsgistidx.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsquery_cleanup.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsquery_gist.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsquery_op.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsquery_rewrite.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsquery_util.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsquery.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsrank.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsvector_op.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsvector_parser.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
tsvector.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
txid.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
uuid.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
varbit.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
varchar.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
varlena.c Re-enable abbreviated keys on Windows. 2015-01-26 14:28:14 -05:00
version.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
windowfuncs.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
xid.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
xml.c Fix namespace handling in xpath function 2015-01-06 23:06:13 -05:00