postgresql/src/include/catalog
Tom Lane 5e09280057 Make pg_statistic and related code account more honestly for collations.
When we first put in collations support, we basically punted on teaching
pg_statistic, ANALYZE, and the planner selectivity functions about that.
They've just used DEFAULT_COLLATION_OID independently of the actual
collation of the data.  It's time to improve that, so:

* Add columns to pg_statistic that record the specific collation associated
with each statistics slot.

* Teach ANALYZE to use the column's actual collation when comparing values
for statistical purposes, and record this in the appropriate slot.  (Note
that type-specific typanalyze functions are now expected to fill
stats->stacoll with the appropriate collation, too.)

* Teach assorted selectivity functions to use the actual collation of
the stats they are looking at, instead of just assuming it's
DEFAULT_COLLATION_OID.

This should give noticeably better results in selectivity estimates for
columns with nondefault collations, at least for query clauses that use
that same collation (which would be the default behavior in most cases).
It's still true that comparisons with explicit COLLATE clauses different
from the stored data's collation won't be well-estimated, but that's no
worse than before.  Also, this patch does make the first step towards
doing better with that, which is that it's now theoretically possible to
collect stats for a collation other than the column's own collation.

Patch by me; thanks to Peter Eisentraut for review.

Discussion: https://postgr.es/m/14706.1544630227@sss.pgh.pa.us
2018-12-14 12:52:49 -05:00
..
.gitignore Replace our traditional initial-catalog-data format with a better design. 2018-04-08 13:17:27 -04:00
binary_upgrade.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
catalog.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
catversion.h Make pg_statistic and related code account more honestly for collations. 2018-12-14 12:52:49 -05:00
dependency.h Local partitioned indexes 2018-01-19 11:49:22 -03:00
duplicate_oids Fix duplicate_oids and unused_oids so user needn't cd to catalog dir. 2018-04-26 11:20:01 -04:00
genbki.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
heap.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
index.h Fix event triggers for partitioned tables 2018-10-06 19:17:46 -03:00
indexing.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
Makefile Make reformat-dat-files, reformat-dat-files VPATH safe. 2018-11-15 11:38:03 -08:00
namespace.h Make autovacuum more aggressive to remove orphaned temp tables 2018-08-13 11:49:04 +02:00
objectaccess.h Fix typo 2018-03-07 09:02:57 -05:00
objectaddress.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
opfam_internal.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
partition.h Redesign initialization of partition routing structures 2018-11-16 15:01:05 -03:00
pg_aggregate.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_aggregate.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_am.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_am.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_amop.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_amop.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_amproc.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_amproc.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_attrdef.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_attribute.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_auth_members.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_authid.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_authid.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_cast.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_cast.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_class.dat Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_class.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_collation.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_collation.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_constraint.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_control.h Revert "Allow on-line enabling and disabling of data checksums" 2018-04-09 19:03:42 +02:00
pg_conversion.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_database.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_database.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_db_role_setting.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_default_acl.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_depend.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_description.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_enum.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_event_trigger.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_extension.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_foreign_data_wrapper.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_foreign_server.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_foreign_table.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_index.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_inherits.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_init_privs.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_language.dat Cosmetic improvement: use BKI_DEFAULT and BKI_LOOKUP in pg_language. 2018-04-29 13:26:26 -04:00
pg_language.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_largeobject.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_largeobject_metadata.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_namespace.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_namespace.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_opclass.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_opclass.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_operator.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_operator.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_opfamily.dat Remove unreferenced pg_opfamily entry. 2018-11-05 12:02:27 -05:00
pg_opfamily.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_partitioned_table.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_pltemplate.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_pltemplate.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_policy.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_proc.dat Add timestamp of last received message from standby to pg_stat_replication 2018-12-09 16:35:06 +09:00
pg_proc.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_publication.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_publication_rel.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_range.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_range.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_replication_origin.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_rewrite.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_seclabel.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_sequence.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_shdepend.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_shdescription.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_shseclabel.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_statistic.h Make pg_statistic and related code account more honestly for collations. 2018-12-14 12:52:49 -05:00
pg_statistic_ext.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_subscription.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_subscription_rel.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_tablespace.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_tablespace.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_transform.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_trigger.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_ts_config.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_ts_config.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_ts_config_map.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_ts_config_map.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_ts_dict.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_ts_dict.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_ts_parser.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_ts_parser.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_ts_template.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_ts_template.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_type.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_type.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
pg_user_mapping.h Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
reformat_dat_file.pl Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
storage.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage_xlog.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
toasting.h Add toast tables to most system catalogs 2018-07-20 07:43:41 +09:00
unused_oids Create a separate oid range for oids assigned by genbki.pl. 2018-12-13 14:50:57 -08:00