On Mon, Sep 29, 2025 at 9:03 AM Dilip Kumar <[email protected]> wrote: > > I observed that pgstat_btree_page() incorporates the count of new > pages into its free space calculation[1]. Does it make sense to do the > same for hash and gist as well as we are leaning towards making these > consistent. > > [1] > if (PageIsNew(page)) > { > /* fully empty page */ > stat->free_space += BLCKSZ; > } >
Thanks for the feedback. Yes, it makes sense to do the same free space calculation for the other index types unless there is some special handling in btree implementation of the free space. From the pgstattuple code, I don't see any special handling so I have made the change suggested by you. I'm attaching patch v2 with that change. Thanks
v2-0001-Fix-unexpected-zero-page-in-pgstattuple-for-hash-.patch
Description: Binary data
