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

Commitc922353

Browse files
committed
Check for interrupts during tuple-insertion loops.
Normally, this won't matter too much; but if I/O is really slow, forexample because the system is overloaded, we might write many pagesbefore checking for interrupts. A single toast insertion mightwrite up to 1GB of data, and a multi-insert could write hundredsof tuples (and their corresponding TOAST data).
1 parent631e7f6 commitc922353

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,6 +2355,8 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
23552355
boolall_visible_cleared= false;
23562356
intnthispage;
23572357

2358+
CHECK_FOR_INTERRUPTS();
2359+
23582360
/*
23592361
* Find buffer where at least the next tuple will fit. If the page is
23602362
* all-visible, this will also pin the requisite visibility map page.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include"access/tuptoaster.h"
3636
#include"access/xact.h"
3737
#include"catalog/catalog.h"
38+
#include"miscadmin.h"
3839
#include"utils/fmgroids.h"
3940
#include"utils/pg_lzcompress.h"
4041
#include"utils/rel.h"
@@ -1495,6 +1496,8 @@ toast_save_datum(Relation rel, Datum value,
14951496
{
14961497
inti;
14971498

1499+
CHECK_FOR_INTERRUPTS();
1500+
14981501
/*
14991502
* Calculate the size of this chunk
15001503
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp