FWIW my understanding is that the speedup comes mostly from
elimination of
the serialization to a file. That however requires savepoints to handle
aborts of subtransactions - I'm pretty sure I'd be trivial to create a
workload where this will be much slower (with many aborts of large
subtransactions).
I think that instead of defining savepoints it is simpler and more
efficient to use
BeginInternalSubTransaction +
ReleaseCurrentSubTransaction/RollbackAndReleaseCurrentSubTransaction
as it is done in PL/pgSQL (pl_exec.c).
Not sure if it can pr
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company