On Thu, 23 May 2019 at 17:55, Andreas Seltenreich <andreas.seltenre...@credativ.de> wrote: > a customer reported excessive memory usage and out-of-memory ERRORs > after introducing native partitioning in one of their databases. We > could narrow it down to the overhead introduced by the partitioning when > issuing multiple statements in a single query.
"multiple statements in a single query", did you mean to write session or maybe transaction there? Which version? I tried your test case with REL_11_STABLE and I see nowhere near as much memory used in MessageContext. After repeating the query twice, I see: MessageContext: 8388608 total in 11 blocks; 3776960 free (1 chunks); 4611648 used Grand total: 8388608 bytes in 11 blocks; 3776960 free (1 chunks); 4611648 used MessageContext: 8388608 total in 11 blocks; 3776960 free (1 chunks); 4611648 used Grand total: 8388608 bytes in 11 blocks; 3776960 free (1 chunks); 4611648 used which is quite a long way off the 252MB you're getting. perhaps I'm not testing with the same version as you are. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
dump_MessageContext_stats.diff
Description: Binary data