On Fri, Mar 15, 2019 at 3:32 AM Heikki Linnakangas <hlinn...@iki.fi> wrote: > 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.
Relcache rebuild is reeentrant, I think, so we have to be careful about that. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company