Skip to content

Instantly share code, notes, and snippets.

@anarazel
Last active September 20, 2019 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anarazel/5e8a3338fae1a1e07f69c3af99375efb to your computer and use it in GitHub Desktop.
Save anarazel/5e8a3338fae1a1e07f69c3af99375efb to your computer and use it in GitHub Desktop.
WIP: Add support for copying node tree into single allocation.
As an example as to why one would want that, here's a
MemoryContextStats for the same query being added to the
plancache. The query is just a randomly selected one among the queries
issued by \d+.
PREPARE foo AS SELECT c.relchecks, c.relkind, c.relhasindex, c.relhasrules, c.relhastriggers, c.relrowsecurity, c.relforcerowsecurity, false AS relhasoids>
EXECUTE foo ;
With single-allocation:
CachedPlan: 24504 total in 2 blocks; 664 free (0 chunks); 23840 used
Grand total: 24504 bytes in 2 blocks; 664 free (0 chunks); 23840 used
Default:
CachedPlan: 65536 total in 7 blocks; 16016 free (0 chunks); 49520 used
Grand total: 65536 bytes in 7 blocks; 16016 free (0 chunks); 49520 used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment