Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdea5f6c

Browse files
committed
Take fillfactor into account in the new COPY bulk heap insert code.
Jeff Janes
1 parent32fb454 commitdea5f6c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,8 +2093,11 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
20932093
char*scratch=NULL;
20942094
Pagepage;
20952095
boolneedwal;
2096+
SizesaveFreeSpace;
20962097

20972098
needwal= !(options&HEAP_INSERT_SKIP_WAL)&&RelationNeedsWAL(relation);
2099+
saveFreeSpace=RelationGetTargetPageFreeSpace(relation,
2100+
HEAP_DEFAULT_FILLFACTOR);
20982101

20992102
/* Toast and set header data in all the tuples */
21002103
heaptuples=palloc(ntuples*sizeof(HeapTuple));
@@ -2157,7 +2160,7 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
21572160
{
21582161
HeapTupleheaptup=heaptuples[ndone+nthispage];
21592162

2160-
if (PageGetHeapFreeSpace(page)<MAXALIGN(heaptup->t_len))
2163+
if (PageGetHeapFreeSpace(page)-saveFreeSpace<MAXALIGN(heaptup->t_len))
21612164
break;
21622165

21632166
RelationPutHeapTuple(relation,buffer,heaptup);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp