Robert Haas <robertmhaas@gmail.com> writes:
> Here is a patch that helps a good deal. I changed things so that when
> we create a context, we always allocate at least 1kB.
That's going to kill performance in some other cases; subtransactions
in particular rely on the subtransaction's TransactionContext not causing
any actual malloc unless something gets put into the TransactionContext.
regards, tom lane