postgresql/src/backend/utils/adt
Tom Lane 75c46149fc Clean up planner confusion between ncolumns and nkeycolumns.
We're only going to consider key columns when creating indexquals,
so there is no point in having the outer loops in indxpath.c iterate
further than nkeycolumns.

Doing so in match_pathkeys_to_index() is actually wrong, and would have
caused crashes by now, except that we have no index AMs supporting both
amcanorderbyop and amcaninclude.

It's also wrong in relation_has_unique_index_for().  The effect there is
to fail to prove uniqueness even when the index does prove it, if there
are extra columns.

Also future-proof examine_variable() for the day when extra columns can
be expressions, and fix what's either a thinko or just an oversight in
btcostestimate(): we should consider the number of key columns, not the
total, when deciding whether to derate correlation.

None of these things seemed important enough to risk changing in a
just-before-wrap patch, but since we're past the release wrap window,
time to fix 'em.

Discussion: https://postgr.es/m/25526.1549847928@sss.pgh.pa.us
2019-02-12 18:38:32 -05:00
..
acl.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
amutils.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
array_expanded.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
array_selfuncs.c Refactor planner's header files. 2019-01-29 15:48:51 -05:00
array_typanalyze.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
array_userfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
arrayfuncs.c Build out the planner support function infrastructure. 2019-02-09 18:32:23 -05:00
arrayutils.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
ascii.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
bool.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
cash.c Correct constness of a few variables. 2018-10-15 21:01:14 -07:00
char.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
cryptohashes.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
date.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
datetime.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
datum.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dbsize.c Replace heapam.h includes with {table, relation}.h where applicable. 2019-01-21 10:51:37 -08:00
domains.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
encode.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
enum.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
expandeddatum.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
expandedrecord.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
float.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
format_type.c Remove unused macro 2019-02-11 10:07:25 +01:00
formatting.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
genfile.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
geo_ops.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
geo_selfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
geo_spgist.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
inet_cidr_ntop.c Suppress -Wshift-negative-value warnings. 2018-06-17 16:15:11 -04:00
inet_net_pton.c Remove unnecessary parentheses in return statements 2017-09-05 14:52:55 -04:00
int8.c Build out the planner support function infrastructure. 2019-02-09 18:32:23 -05:00
int.c Build out the planner support function infrastructure. 2019-02-09 18:32:23 -05:00
json.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
jsonb_gin.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
jsonb_op.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
jsonb_util.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
jsonb.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
jsonfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
levenshtein.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
like_match.c Add some const decorations 2019-02-08 10:13:24 +01:00
like_support.c Allow extensions to generate lossy index conditions. 2019-02-11 21:26:14 -05:00
like.c Add some const decorations 2019-02-08 10:13:24 +01:00
lockfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
mac8.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
mac.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Allow extensions to generate lossy index conditions. 2019-02-11 21:26:14 -05:00
misc.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
name.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
network_gist.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
network_selfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
network_spgist.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
network.c Allow extensions to generate lossy index conditions. 2019-02-11 21:26:14 -05:00
numeric.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
numutils.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
oid.c Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
oracle_compat.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
orderedsetaggs.c Refactor planner's header files. 2019-01-29 15:48:51 -05:00
partitionfuncs.c Add pg_partition_root to display top-most parent of a partition tree 2019-02-08 08:56:14 +09:00
pg_locale.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_lsn.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_upgrade_support.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgstatfuncs.c Add more columns to pg_stat_ssl 2019-02-01 00:33:47 +01:00
pseudotypes.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
quote.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
rangetypes_gist.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
rangetypes_selfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
rangetypes_spgist.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
rangetypes_typanalyze.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
rangetypes.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
regexp.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
regproc.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
ri_triggers.c Move remaining code from tqual.[ch] to heapam.h / heapam_visibility.c. 2019-01-21 17:07:10 -08:00
rowtypes.c Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
ruleutils.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
selfuncs.c Clean up planner confusion between ncolumns and nkeycolumns. 2019-02-12 18:38:32 -05:00
tid.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
timestamp.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
trigfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsginidx.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsgistidx.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsquery_cleanup.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsquery_gist.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsquery_op.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsquery_rewrite.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsquery_util.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsquery.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsrank.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsvector_op.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsvector_parser.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
tsvector.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
txid.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
uuid.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
varbit.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
varchar.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
varlena.c Fix possibly-uninitialized-variable warning from commit 9556aa01c. 2019-01-25 11:27:44 -05:00
version.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
windowfuncs.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
xid.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
xml.c Defend against null error message reported by libxml2. 2019-02-08 13:30:42 -05:00