Hi,
I took a look at this today, as I committed 39b66a91b back in January. I
can reproduce the issue, with just 1M rows the before/after timings are
roughly 480ms and 620ms on my hardware.
Unfortunately, the v3 patch does not really fix the issue for me. The
timing with it applied is ~610ms so the improvement is only minimal.
I'm not sure what to do about this :-( I don't have any ideas about how
to eliminate this overhead, so the only option I see is reverting the
changes in heap_insert. Unfortunately, that'd mean inserts into TOAST
tables won't be frozen ...
regards
--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company