On 2019-02-20 22:50, Rohan Kadekodi wrote: > Perf tool shows that there is a non-trivial amount of time spent in > DropCachedPlan and AllocSetAlloc. Does this hint to some sort of caching > being done by PostgreSQL, and is there a way to disable this caching? AllocSetAlloc() is memory allocation, which, well, you need some of. ;-) DropCachedPlan() has to do with how statements are prepared and released. You can probably reduce some of that overhead by using prepared statements consistently. Hard to tell without more details about your test script. Have you looked at pgbench? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services