Re: hyrax vs. RelationBuildPartitionDesc
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Robert Haas <robertmhaas@gmail.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-03-15T13:39:47Z
Lists: pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> writes: > On 15/03/2019 00:08, Tom Lane wrote: >> Possibly it'd make sense to conditionally compile this so that we only >> do it in a CLOBBER_CACHE_ALWAYS build. I'm not very sure about that, >> but arguably in a normal build the overhead of making and destroying >> a context would outweigh the cost of the leaked memory. The main >> argument I can think of for doing it all the time is that having memory >> allocation work noticeably differently in CCA builds than normal ones >> seems like a recipe for masking normal-mode bugs from the CCA animals. > Having CLOBBER_CACHE_ALWAYS behave differently sounds horrible. I'm not entirely convinced of that. It's already pretty different... > We maintain a free list of AllocSetContexts nowadays, so creating a > short-lived context should be pretty cheap. Or if it's still too > expensive, we could create one short-lived context as a child of > TopMemoryContext, and reuse that on every call, resetting it at the end > of the function. RelationBuildDesc potentially recurses, so a single context won't do. Perhaps you're right that the context freelist would make this cheap enough to not matter, but I'm not sure of that either. What I'm inclined to do to get the buildfarm pressure off is to set things up so that by default we do this only in CCA builds, but there's a #define you can set from the compile command line to override that decision in either direction. Then, if somebody wants to investigate the performance effects in more detail, they could twiddle it easily. Depending on the results, we could alter the default policy. regards, tom lane
Commits
-
Load relcache entries' partitioning data on-demand, not immediately.
- 5b9312378e2f 13.0 landed
-
Prevent memory leaks associated with relcache rd_partcheck structures.
- d4c50b4b1f86 10.8 landed
- 5f1433ac5e7f 12.0 landed
- 089e4d405d0f 11.3 landed
-
Don't copy PartitionBoundInfo in set_relation_partition_info.
- c8151e642368 12.0 landed
-
Further reduce memory footprint of CLOBBER_CACHE_ALWAYS testing.
- d3f48dfae42f 12.0 landed
-
Fix some oversights in commit 2455ab488.
- de570047993b 12.0 landed
-
Defend against leaks into RelationBuildPartitionDesc.
- 2455ab48844c 12.0 landed
-
Allow ATTACH PARTITION with only ShareUpdateExclusiveLock.
- 898e5e3290a7 12.0 cited