Significance of the magic number of btree pages..?

Started by Anil Kumaralmost 17 years ago2 messages
#1Anil Kumar
anil_csir@yahoo.com

Hi to All,
Iam new to the group and to postgresql. Currently Iam trying to understand how does the planner work by using gdb. During the execution of a plan I observed a variable "BTREE_MAGIC" which is defined 0x053162 and called, 'the magic number of btree pages'. I couldnt understand the concept behind the 'magic number' and the "0x053162". Can anyone kindly explain the significance of the 'magic number of btree pages' or refer to some document where I can get idea about this.

Thanks in Advance,
Anil

Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Anil Kumar (#1)
Re: Significance of the magic number of btree pages..?

Anil Kumar wrote:

Hi to All,
Iam new to the group and to postgresql. Currently Iam trying to understand how does the planner work by using gdb. During the execution of a plan I observed a variable "BTREE_MAGIC" which is defined 0x053162 and called, 'the magic number of btree pages'. I couldnt understand the concept behind the 'magic number' and the "0x053162". Can anyone kindly explain the significance of the 'magic number of btree pages' or refer to some document where I can get idea about this.

It's just a sanity check and a debugging aid, to let you check that a
b-tree metapage is indeed a b-tree metapage.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com