diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-11-06 20:51:15 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-11-06 20:51:15 +0000 |
| commit | 85e2cedf985bfecaf43a18ca17433070f439fb0e (patch) | |
| tree | 9348349050eaa2a8a863297c88502263c3a2e338 /src/include/access/heapam.h | |
| parent | cdc197cf3100359cd436757adc0002dad07e3117 (diff) | |
| download | postgresql-85e2cedf985bfecaf43a18ca17433070f439fb0e.tar.gz | |
Improve bulk-insert performance by keeping the current target buffer pinned
(but not locked, as that would risk deadlocks). Also, make it work in a small
ring of buffers to avoid having bulk inserts trash the whole buffer arena.
Robert Haas, after an idea of Simon Riggs'.
Diffstat (limited to 'src/include/access/heapam.h')
| -rw-r--r-- | src/include/access/heapam.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index b24edea6e4..1b78b40cc5 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.139 2008/10/08 01:14:44 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.140 2008/11/06 20:51:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,6 +25,12 @@ #include "utils/snapshot.h" +/* "options" flag bits for heap_insert */ +#define HEAP_INSERT_SKIP_WAL 0x0001 +#define HEAP_INSERT_SKIP_FSM 0x0002 + +typedef struct BulkInsertStateData *BulkInsertState; + typedef enum { LockTupleShared, @@ -86,8 +92,11 @@ extern void heap_get_latest_tid(Relation relation, Snapshot snapshot, ItemPointer tid); extern void setLastTid(const ItemPointer tid); +extern BulkInsertState GetBulkInsertState(void); +extern void FreeBulkInsertState(BulkInsertState); + extern Oid heap_insert(Relation relation, HeapTuple tup, CommandId cid, - bool use_wal, bool use_fsm); + int options, BulkInsertState bistate); extern HTSU_Result heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid, TransactionId *update_xmax, CommandId cid, Snapshot crosscheck, bool wait); |
