1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Optimize COPY FREEZE with CREATE TABLE also.

Jeff Davis, additional test by me
This commit is contained in:
Simon Riggs
2012-12-07 13:26:52 +00:00
parent 1eb6cee499
commit 1f023f9297
3 changed files with 19 additions and 4 deletions

View File

@ -2002,7 +2002,8 @@ CopyFrom(CopyState cstate)
if (cstate->freeze &&
ThereAreNoPriorRegisteredSnapshots() &&
ThereAreNoReadyPortals() &&
cstate->rel->rd_newRelfilenodeSubid == GetCurrentSubTransactionId())
(cstate->rel->rd_newRelfilenodeSubid == GetCurrentSubTransactionId() ||
cstate->rel->rd_createSubid == GetCurrentSubTransactionId()))
hi_options |= HEAP_INSERT_FROZEN;
}