mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Support unlogged GiST index.
The reason this wasn't supported before was that GiST indexes need an increasing sequence to detect concurrent page-splits. In a regular WAL- logged GiST index, the LSN of the page-split record is used for that purpose, and in a temporary index, we can get away with a backend-local counter. Neither of those methods works for an unlogged relation. To provide such an increasing sequence of numbers, create a "fake LSN" counter that is saved and restored across shutdowns. On recovery, unlogged relations are blown away, so the counter doesn't need to survive that either. Jeevan Chalke, based on discussions with Robert Haas, Tom Lane and me.
This commit is contained in:
@@ -512,7 +512,7 @@ extern void gistMakeUnionKey(GISTSTATE *giststate, int attno,
|
||||
GISTENTRY *entry2, bool isnull2,
|
||||
Datum *dst, bool *dstisnull);
|
||||
|
||||
extern XLogRecPtr GetXLogRecPtrForTemp(void);
|
||||
extern XLogRecPtr gistGetFakeLSN(Relation rel);
|
||||
|
||||
/* gistvacuum.c */
|
||||
extern Datum gistbulkdelete(PG_FUNCTION_ARGS);
|
||||
|
@@ -294,6 +294,7 @@ extern char *XLogFileNameP(TimeLineID tli, XLogSegNo segno);
|
||||
|
||||
extern void UpdateControlFile(void);
|
||||
extern uint64 GetSystemIdentifier(void);
|
||||
extern XLogRecPtr GetFakeLSNForUnloggedRel(void);
|
||||
extern Size XLOGShmemSize(void);
|
||||
extern void XLOGShmemInit(void);
|
||||
extern void BootStrapXLOG(void);
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
/* Version identifier for this pg_control format */
|
||||
#define PG_CONTROL_VERSION 934
|
||||
#define PG_CONTROL_VERSION 935
|
||||
|
||||
/*
|
||||
* Body of CheckPoint XLOG records. This is declared here because we keep
|
||||
@@ -126,6 +126,8 @@ typedef struct ControlFileData
|
||||
|
||||
CheckPoint checkPointCopy; /* copy of last check point record */
|
||||
|
||||
XLogRecPtr unloggedLSN; /* current fake LSN value, for unlogged rels */
|
||||
|
||||
/*
|
||||
* These two values determine the minimum point we must recover up to
|
||||
* before starting up:
|
||||
|
Reference in New Issue
Block a user