diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-13 20:45:47 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-13 20:45:47 +0000 |
commit | 9d035f425452279041c52e01cf83b2a27e121b5c (patch) | |
tree | d521a3bdb9ca231ed49e09a48259a45b519f6d1c /src/include/access/nbtree.h | |
parent | 45efb09a01e93d20ccb5671703649d9f87f744de (diff) |
Clean up the use of some page-header-access macros: principally, use
SizeOfPageHeaderData instead of sizeof(PageHeaderData) in places where that
makes the code clearer, and avoid casting between Page and PageHeader where
possible. Zdenek Kotala, with some additional cleanup by Heikki Linnakangas.
I did not apply the parts of the proposed patch that would have resulted in
slightly changing the on-disk format of hash indexes; it seems to me that's
not a win as long as there's any chance of having in-place upgrade for 8.4.
Diffstat (limited to 'src/include/access/nbtree.h')
-rw-r--r-- | src/include/access/nbtree.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 9b0e8d0cf77..e0bc10c0642 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.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/nbtree.h,v 1.120 2008/06/19 00:46:06 alvherre Exp $ + * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.121 2008/07/13 20:45:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -113,13 +113,10 @@ typedef struct BTMetaPageData * * We actually need to be able to fit three items on every page, * so restrict any one item to 1/3 the per-page available space. - * - * Note: sizeof(PageHeaderData) includes the first ItemId, but we have - * to allow for 2 more, as well as the end-of-page special space. */ #define BTMaxItemSize(page) \ MAXALIGN_DOWN((PageGetPageSize(page) - \ - MAXALIGN(sizeof(PageHeaderData) + 2*sizeof(ItemIdData)) - \ + MAXALIGN(SizeOfPageHeaderData + 3*sizeof(ItemIdData)) - \ MAXALIGN(sizeof(BTPageOpaqueData))) / 3) /* |