diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-06-22 18:53:27 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-06-22 18:53:27 -0400 |
commit | 2cb9ec1bcb35dd6b4cf7a4a325aaa9791444e69d (patch) | |
tree | 6b070d15bfd5a46003d1f5d20120b8057c36fdff /contrib/btree_gist/btree_gist.c | |
parent | da9ee026a0ddd100785b00defd1201b317c0797b (diff) | |
download | postgresql-2cb9ec1bcb35dd6b4cf7a4a325aaa9791444e69d.tar.gz postgresql-2cb9ec1bcb35dd6b4cf7a4a325aaa9791444e69d.zip |
Improve inheritance_planner()'s performance for large inheritance sets.
Commit c03ad5602f529787968fa3201b35c119bbc6d782 introduced a planner
performance regression for UPDATE/DELETE on large inheritance sets.
It required copying the append_rel_list (which is of size proportional to
the number of inherited tables) once for each inherited table, thus
resulting in O(N^2) time and memory consumption. While it's difficult to
avoid that in general, the extra work only has to be done for
append_rel_list entries that actually reference subquery RTEs, which
inheritance-set entries will not. So we can buy back essentially all of
the loss in cases without subqueries in FROM; and even for those, the added
work is mainly proportional to the number of UNION ALL subqueries.
Back-patch to 9.2, like the previous commit.
Tom Lane and Dean Rasheed, per a complaint from Thomas Munro.
Diffstat (limited to 'contrib/btree_gist/btree_gist.c')
0 files changed, 0 insertions, 0 deletions