diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2021-03-10 14:22:31 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2021-03-10 14:22:31 -0500 |
commit | c3ffe34863688115dd7878f118f2a123bafd8a26 (patch) | |
tree | 7cf4577a73c9ae4c4e47f9bbeef25f4c188bb59c /src/include/access/gist.h | |
parent | b12436340adf27aa3d334c92579e6662dd3090ce (diff) | |
download | postgresql-c3ffe34863688115dd7878f118f2a123bafd8a26.tar.gz postgresql-c3ffe34863688115dd7878f118f2a123bafd8a26.zip |
Avoid creating duplicate cached plans for inherited FK constraints.
When a foreign key constraint is applied to a partitioned table, each
leaf partition inherits a similar FK constraint. We were processing all
of those constraints independently, meaning that in large partitioning
trees we'd build up large collections of cached FK-checking query plans.
However, in all cases but one, the generated queries are actually
identical for all members of the inheritance tree (because, in most
cases, the query only mentions the topmost table of the other side of
the FK relationship). So we can share a single cached plan among all
the partitions, saving memory, not to mention time to build and maintain
the cached plans.
Keisuke Kuroda and Amit Langote
Discussion: https://postgr.es/m/cab4b85d-9292-967d-adf2-be0d803c3e23@nttcom.co.jp_1
Diffstat (limited to 'src/include/access/gist.h')
0 files changed, 0 insertions, 0 deletions