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

Commit8e95321

Browse files
committed
Btree WAL records.
1 parent0d93504 commit8e95321

File tree

1 file changed

+67
-1
lines changed

1 file changed

+67
-1
lines changed

‎src/include/access/nbtree.h

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: nbtree.h,v 1.41 2000/08/10 02:33:19 inoue Exp $
10+
* $Id: nbtree.h,v 1.42 2000/09/12 06:07:52 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -183,6 +183,72 @@ typedef BTStackData *BTStack;
183183
#defineP_FIRSTKEY((OffsetNumber) 2)
184184
#defineP_FIRSTDATAKEY(opaque) (P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY)
185185

186+
187+
#ifdefXLOG
188+
189+
/* XLOG stuff */
190+
191+
/*
192+
* XLOG allows to store some information in high 4 bits of log
193+
* record xl_info field
194+
*/
195+
#defineXLOG_BTREE_DELETE0x00/* delete btitem */
196+
#defineXLOG_BTREE_INSERT0x10/* add btitem without split */
197+
#defineXLOG_BTREE_SPLIT0x20/* add btitem with split */
198+
#defineXLOG_BTREE_ONLEFT0x40/* flag for split case: new btitem */
199+
/* goes to the left sibling */
200+
201+
/*
202+
* All what we need to find changed index tuple (18 bytes)
203+
*/
204+
typedefstructxl_btreetid
205+
{
206+
RelFileNodenode;
207+
CommandIdcid;/* this is for "better" tuple' */
208+
/* identification - it allows to avoid */
209+
/* "compensation" records for undo */
210+
ItemPointerDatatid;/* changed tuple id */
211+
}xl_btreetid;
212+
213+
/* This is what we need to know about delete - ALIGN(18) = 24 bytes */
214+
typedefstructxl_btree_delete
215+
{
216+
xl_btreetidtarget;/* deleted tuple id */
217+
}xl_btree_delete;
218+
219+
#defineSizeOfBtreeDelete(offsetof(xl_btreetid, tid) + SizeOfIptrData))
220+
221+
/* This is what we need to know about pure (without split) insert - 26 + key data */
222+
typedefstructxl_btree_insert
223+
{
224+
xl_btreetidtarget;/* inserted tuple id */
225+
BTItemDatabtitem;
226+
/* KEY DATA FOLLOWS AT END OF STRUCT */
227+
}xl_btree_insert;
228+
229+
#defineSizeOfBtreeInsert(offsetof(xl_btree_insert, btitem) + sizeof(BTItemData))
230+
231+
232+
/* This is what we need to know about insert with split - 26 + right sibling btitems */
233+
typedefstructxl_btree_split
234+
{
235+
xl_btreetidtarget;/* inserted tuple id */
236+
BlockNumberothblk;/* second block participated in split: */
237+
/* first one is stored in target' tid */
238+
BlockNumberparblk;/* parent block to be updated */
239+
/*
240+
* We log all btitems from the right sibling. If new btitem goes on
241+
* the left sibling then we log it too and it will be first BTItemData
242+
* at the end of this struct.
243+
*/
244+
}xl_btree_split;
245+
246+
#defineSizeOfBtreeSplit(offsetof(xl_btree_insert, parblk) + sizeof(BlockNumber))
247+
248+
/* end of XLOG stuff */
249+
250+
#endif/* XLOG */
251+
186252
/*
187253
*Operator strategy numbers -- ordering of these is <, <=, =, >=, >
188254
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp