From: jingwei_5107@qq.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13604: fsm NonLeafNodesPerPage Macro
Date: Wed, 02 Sep 2015 03:46:08 +0000
Message-ID: <20150902034608.1378.91@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13604
Logged by: will
Email address: jingwei_5107@qq.com
PostgreSQL version: 9.4.4
Operating system: windows
Description:
In fsm_internals.h, it defines:
/*
* Number of non-leaf and leaf nodes, and nodes in total, on an FSM page.
* These definitions are internal to fsmpage.c.
*/
#define NodesPerPage (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) - \
offsetof(FSMPageData, fp_nodes))
#define NonLeafNodesPerPage (BLCKSZ / 2 - 1)
#define LeafNodesPerPage (NodesPerPage - NonLeafNodesPerPage)
I can understand the NodesPerPage & LeafNodesPerPage, but do not undertand
the second NonLeafNodesPerPage Macro.
Should it be like:
#define NonLeafNodesPerPage (NodesPerPage / 2 - 1)
? Since BLCKSZ contains extra Page hdr&FSMPage hdr, NonLeafNodesPerPage will
be larger than its true value.
I have not much document at hand, more possibility is my misunderstanding of
the code. If so, pls let me know. Thanks!
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: jingwei_5107@qq.com
Subject: Re: BUG #13604: fsm NonLeafNodesPerPage Macro
In-Reply-To: <20150902034608.1378.91@wrigleys.postgresql.org>
References: <20150902034608.1378.91@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox