BUG #13604: fsm NonLeafNodesPerPage Macro

From: jingwei_5107(at)qq(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13604: fsm NonLeafNodesPerPage Macro
Date: 2015-09-02 03:46:08
Message-ID: 20150902034608.1378.91@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13604
Logged by: will
Email address: jingwei_5107(at)qq(dot)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!

Browse pgsql-bugs by date

  From Date Subject
Next Message vahdet.mert 2015-09-02 06:04:08 BUG #13605: How to enable PgAdmin Query Tool Favorites
Previous Message Michael Paquier 2015-09-02 01:14:57 Re: GRANT USAGE ON SEQUENCE missing from psql command completion