pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Clean up planner confusion between ncolumns and nkeycolumns. 2+ messages / 1 participants [nested] [flat]
* pgsql: Clean up planner confusion between ncolumns and nkeycolumns. @ 2019-02-12 23:38 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2019-02-12 23:38 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/75c46149fc2215b046aa56caaf59f8125f0e6062 Modified Files -------------- src/backend/optimizer/path/indxpath.c | 23 ++++++++++++----------- src/backend/utils/adt/selfuncs.c | 7 ++++++- 2 files changed, 18 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Clean up planner confusion between ncolumns and nkeycolumns. @ 2019-02-12 23:38 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2019-02-12 23:38 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/364857f738982da58c0be33cf968d2bbbd496efd Modified Files -------------- src/backend/optimizer/path/indxpath.c | 23 ++++++++++++----------- src/backend/utils/adt/selfuncs.c | 7 ++++++- 2 files changed, 18 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-02-12 23:38 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-02-12 23:38 pgsql: Clean up planner confusion between ncolumns and nkeycolumns. Tom Lane <tgl@sss.pgh.pa.us> 2019-02-12 23:38 pgsql: Clean up planner confusion between ncolumns and nkeycolumns. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox