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

Commit813b456

Browse files
committed
Add page id to bloom index
Added to ensure that bloom index pages can be distinguished from other pagesby pg_filedump. Because there wasn't any public/production versions before,it doesn't pay attention to any compatibility issues.Per notice from Tom Lane
1 parente7bcde8 commit813b456

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

‎contrib/bloom/bloom.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@
3131
/* Opaque for bloom pages */
3232
typedefstructBloomPageOpaqueData
3333
{
34-
OffsetNumbermaxoff;
35-
uint16flags;
34+
OffsetNumbermaxoff;/* number of index tuples on page */
35+
uint16flags;/* see bit definitions below */
36+
uint16unused;/* placeholder to force maxaligning of size
37+
* of BloomPageOpaqueData and to place
38+
* bloom_page_id exactly at the end of page
39+
*/
40+
uint16bloom_page_id;/* for identification of BLOOM indexes */
3641
}BloomPageOpaqueData;
3742

3843
typedefBloomPageOpaqueData*BloomPageOpaque;
@@ -41,6 +46,16 @@ typedef BloomPageOpaqueData *BloomPageOpaque;
4146
#defineBLOOM_META(1<<0)
4247
#defineBLOOM_DELETED(2<<0)
4348

49+
/*
50+
* The page ID is for the convenience of pg_filedump and similar utilities,
51+
* which otherwise would have a hard time telling pages of different index
52+
* types apart. It should be the last 2 bytes on the page. This is more or
53+
* less "free" due to alignment considerations.
54+
*
55+
* See comments above GinPageOpaqueData.
56+
*/
57+
#defineBLOOM_PAGE_ID0xFF83
58+
4459
/* Macros for accessing bloom page structures */
4560
#defineBloomPageGetOpaque(page) ((BloomPageOpaque) PageGetSpecialPointer(page))
4661
#defineBloomPageGetMaxOffset(page) (BloomPageGetOpaque(page)->maxoff)

‎contrib/bloom/blutils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ BloomInitPage(Page page, uint16 flags)
359359
opaque=BloomPageGetOpaque(page);
360360
memset(opaque,0,sizeof(BloomPageOpaqueData));
361361
opaque->flags=flags;
362+
opaque->bloom_page_id=BLOOM_PAGE_ID;
362363
}
363364

364365
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp