postgresql/src/include/catalog
Alvaro Herrera 3f2393edef Redesign initialization of partition routing structures
This speeds up write operations (INSERT, UPDATE, DELETE, COPY, as well
as the future MERGE) on partitioned tables.

This changes the setup for tuple routing so that it does far less work
during the initial setup and pushes more work out to when partitions
receive tuples.  PartitionDispatchData structs for sub-partitioned
tables are only created when a tuple gets routed through it.  The
possibly large arrays in the PartitionTupleRouting struct have largely
been removed.  The partitions[] array remains but now never contains any
NULL gaps.  Previously the NULLs had to be skipped during
ExecCleanupTupleRouting(), which could add a large overhead to the
cleanup when the number of partitions was large.  The partitions[] array
is allocated small to start with and only enlarged when we route tuples
to enough partitions that it runs out of space. This allows us to keep
simple single-row partition INSERTs running quickly.  Redesign

The arrays in PartitionTupleRouting which stored the tuple translation maps
have now been removed.  These have been moved out into a
PartitionRoutingInfo struct which is an additional field in ResultRelInfo.

The find_all_inheritors() call still remains by far the slowest part of
ExecSetupPartitionTupleRouting(). This commit just removes the other slow
parts.

In passing also rename the tuple translation maps from being ParentToChild
and ChildToParent to being RootToPartition and PartitionToRoot. The old
names mislead you into thinking that a partition of some sub-partitioned
table would translate to the rowtype of the sub-partitioned table rather
than the root partitioned table.

Authors: David Rowley and Amit Langote, heavily revised by Álvaro Herrera
Testing help from Jesper Pedersen and Kato Sho.
Discussion: https://postgr.es/m/CAKJS1f_1RJyFquuCKRFHTdcXqoPX-PYqAd7nz=GVBwvGh4a6xA@mail.gmail.com
2018-11-16 15:01:05 -03:00
..
.gitignore Replace our traditional initial-catalog-data format with a better design. 2018-04-08 13:17:27 -04:00
Makefile Make reformat-dat-files, reformat-dat-files VPATH safe. 2018-11-15 11:38:03 -08:00
binary_upgrade.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
catalog.h Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
catversion.h Add a timezone-specific variant of date_trunc(). 2018-11-14 15:41:07 -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 Teach genbki.pl to auto-generate pg_type entries for array types. 2018-09-20 15:14:46 -04:00
heap.h Correct constness of system attributes in heap.c & prerequisites. 2018-10-16 09:44:43 -07:00
index.h Fix event triggers for partitioned tables 2018-10-06 19:17:46 -03:00
indexing.h Fully enforce uniqueness of constraint names. 2018-09-04 13:45:35 -04: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 Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05: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 Improve spelling of new FINALFUNC_MODIFY aggregate attribute. 2018-05-21 11:41:42 -04:00
pg_am.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_am.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_amop.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_amop.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_amproc.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_amproc.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_attrdef.h Remove obsolete pg_attrdef.adsrc column 2018-11-01 20:35:42 +01:00
pg_attribute.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_auth_members.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_authid.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_authid.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_cast.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_cast.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_class.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_class.h Clarify descriptions of relhassubclass and relispartition in pg_class 2018-10-22 15:26:28 +09:00
pg_collation.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_collation.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_constraint.h Remove obsolete pg_constraint.consrc column 2018-11-01 20:36:05 +01: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 Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_database.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_database.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_db_role_setting.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_default_acl.h Add some not null constraints to catalogs 2018-08-27 16:21:23 +02:00
pg_depend.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_description.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_enum.h Relax transactional restrictions on ALTER TYPE ... ADD VALUE (redux). 2018-10-09 12:51:01 +13:00
pg_event_trigger.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_extension.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_foreign_data_wrapper.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_foreign_server.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_foreign_table.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_index.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_inherits.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_init_privs.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04: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 Cosmetic improvement: use BKI_DEFAULT and BKI_LOOKUP in pg_language. 2018-04-29 13:26:26 -04:00
pg_largeobject.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_largeobject_metadata.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_namespace.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_namespace.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_opclass.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_opclass.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_operator.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_operator.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_opfamily.dat Remove unreferenced pg_opfamily entry. 2018-11-05 12:02:27 -05:00
pg_opfamily.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_partitioned_table.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_pltemplate.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_pltemplate.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_policy.h Add some not null constraints to catalogs 2018-08-27 16:21:23 +02:00
pg_proc.dat Add a timezone-specific variant of date_trunc(). 2018-11-14 15:41:07 -05:00
pg_proc.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_publication.h Refactor routines for subscription and publication lookups 2018-09-18 12:00:18 +09:00
pg_publication_rel.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_range.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_range.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_replication_origin.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_rewrite.h Add some not null constraints to catalogs 2018-08-27 16:21:23 +02:00
pg_seclabel.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_sequence.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_shdepend.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_shdescription.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_shseclabel.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_statistic.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_statistic_ext.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_subscription.h Refactor routines for subscription and publication lookups 2018-09-18 12:00:18 +09:00
pg_subscription_rel.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_tablespace.dat Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_tablespace.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_transform.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_trigger.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04: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 Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04: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 Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04: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 Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04: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 Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04: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 Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
pg_type.dat Remove deprecated abstime, reltime, tinterval datatypes. 2018-10-11 11:59:15 -07:00
pg_type.h Fix missing role dependencies for some schema and type ACLs. 2018-11-09 20:42:14 -05:00
pg_user_mapping.h Improve consistency of comments in system catalog headers. 2018-04-19 17:14:09 -04:00
reformat_dat_file.pl Teach genbki.pl to auto-generate pg_type entries for array types. 2018-09-20 15:14:46 -04: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 Assorted minor cleanups for bootstrap-data Perl scripts. 2018-05-19 16:04:47 -04:00