pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Use column collation for extended statistics 2+ messages / 1 participants [nested] [flat]
* pgsql: Use column collation for extended statistics @ 2019-07-20 14:35 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Tomas Vondra @ 2019-07-20 14:35 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use column collation for extended statistics The current extended statistics code was a bit confused which collation to use. When building the statistics, the collations defined as default for the data types were used (since commit 5e0928005). The MCV code was however using the column collations for MCV serialization, and then DEFAULT_COLLATION_OID when computing estimates. So overall the code was using all three possible options, inconsistently. This uses the column colation everywhere - this makes it consistent with what 5e0928005 did for regular stats. We however do not track the collations in a catalog, because we can derive them from column-level information. This may need to change in the future, e.g. after allowing statistics on expressions. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/8736jdhbhc.fsf%40ansel.ydns.eu Backpatch-to: 12 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5a8ee9f2dbe040b9a0cb7f73a4376633f93b4ab4 Modified Files -------------- src/backend/commands/statscmds.c | 4 ++++ src/backend/statistics/dependencies.c | 2 +- src/backend/statistics/mcv.c | 15 +++++++++++---- src/backend/statistics/mvdistinct.c | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Use column collation for extended statistics @ 2019-07-20 14:37 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Tomas Vondra @ 2019-07-20 14:37 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use column collation for extended statistics The current extended statistics code was a bit confused which collation to use. When building the statistics, the collations defined as default for the data types were used (since commit 5e0928005). The MCV code was however using the column collations for MCV serialization, and then DEFAULT_COLLATION_OID when computing estimates. So overall the code was using all three possible options, inconsistently. This uses the column colation everywhere - this makes it consistent with what 5e0928005 did for regular stats. We however do not track the collations in a catalog, because we can derive them from column-level information. This may need to change in the future, e.g. after allowing statistics on expressions. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/8736jdhbhc.fsf%40ansel.ydns.eu Backpatch-to: 12 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/a63378a03ec0a53c7c579dfdb3abff57811d8ced Modified Files -------------- src/backend/commands/statscmds.c | 4 ++++ src/backend/statistics/dependencies.c | 2 +- src/backend/statistics/mcv.c | 15 +++++++++++---- src/backend/statistics/mvdistinct.c | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-07-20 14:37 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-07-20 14:35 pgsql: Use column collation for extended statistics Tomas Vondra <tomas.vondra@postgresql.org> 2019-07-20 14:37 pgsql: Use column collation for extended statistics Tomas Vondra <tomas.vondra@postgresql.org>
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