Re: unsupportable composite type partition keys
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <amitlangote09@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-12-25T18:21:31Z
Lists: pgsql-hackers
I wrote: > Amit Langote <amitlangote09@gmail.com> writes: >> On Tue, Dec 24, 2019 at 10:59 AM Amit Langote <amitlangote09@gmail.com> wrote: >>> Btw, does the memory leakage fix in this patch address any of the >>> pending concerns that were discussed on the "hyrax vs. >>> RelationBuildPartitionDesc" thread earlier this year[1]? >>> [1] https://www.postgresql.org/message-id/flat/3800.1560366716%40sss.pgh.pa.us#092b6b4f6bf75d2f3f90ef6a3b3eab5b >> I thought about this a little and I think it *does* address the main >> complaint in the above thread. It occurred to me to also recheck the original complaint in that thread, which was poor behavior in CLOBBER_CACHE_ALWAYS builds. I didn't have the patience to run a full CCA test, but I did run update.sql, which we previously established was sufficient to show the problem. There's no apparent memory bloat, either with HEAD or with the patch. I also see the runtime (for update.sql on its own) dropping from about 474 sec in HEAD to 457 sec with the patch. So that indicates that we're actually saving a noticeable amount of work, not just postponing it, at least under CCA scenarios where relcache entries get flushed a lot. I also tried to measure update.sql's runtime in a regular debug build (not CCA). I get pretty repeatable results of 279ms on HEAD vs 273ms with patch, or about a 2% overall savings. That's at the very limit of what I'd consider a reproducible difference, but still it seems to be real. So that seems like evidence that forcing the partition data to be loaded immediately rather than on-demand is a loser from a performance standpoint as well as the recursion concerns that prompted this patch. Which naturally leads one to wonder whether forcing other relcache substructures (triggers, rules, etc) to be loaded immediately isn't a loser as well. I'm still feeling like we're overdue to redesign how all of this works and come up with a more uniform, less fragile/ad-hoc approach. But I don't have the time or interest to do that right now. Anyway, I've run out of reasons not to commit this patch, so I'll go do that. regards, tom lane
Commits
-
Fix CheckAttributeType's handling of collations for ranges.
- f521ef0ae319 9.4.26 landed
- de3d2df75169 10.12 landed
- 74b35eb468dc 13.0 landed
- 742c646c1987 9.6.17 landed
- 65aa155135a5 12.2 landed
- 59047b6d0c93 9.5.21 landed
- 25dc267a1be5 11.7 landed
-
Improve comments in utils/rel.h.
- fbe0232358c1 13.0 landed
-
Allow whole-row Vars to be used in partitioning expressions.
- bb4114a4e2c6 13.0 landed
-
Remove equalPartitionDescs().
- 42f74f49367b 13.0 landed
-
Load relcache entries' partitioning data on-demand, not immediately.
- 5b9312378e2f 13.0 landed
-
Disallow partition key expressions that return pseudo-types.
- ea1205a02a03 10.12 landed
- 7fbb39a967ea 12.2 landed
- 281dd22ac015 11.7 landed
- 39ebb943de9d 13.0 landed
-
Prevent a rowtype from being included in itself via a range.
- 6609c3ad984b 9.5.21 landed
- 4af2531d0393 10.12 landed
- 354d913f9745 9.6.17 landed
- 31dfa40a8341 11.7 landed
- 0d245d13c643 9.4.26 landed
- fc7695891d35 13.0 landed
- 976cb11f6c58 12.2 landed