BlockNumber blkno;
char res[1024];
uint32 totalPages,
+#if PG_VERSION_NUM >= 100000
+ deletedPages = 0,
+ emptyDataPages = 0,
+#endif
entryPages = 0,
dataPages = 0,
dataInnerPages = 0,
page = BufferGetPage(buffer);
header = (PageHeader)page;
+#if PG_VERSION_NUM >= 100000
+ if (GinPageIsDeleted(page))
+ {
+ deletedPages++;
+ }
+ else
+#endif
if (GinPageIsData(page))
{
dataPages++;
if (GinPageIsLeaf(page))
{
- ItemPointerData minItem;
+ ItemPointerData minItem, *ptr;
int nlist;
+
dataLeafPages++;
dataLeafFreeSpace += header->pd_upper - header->pd_lower;
ItemPointerSetMin(&minItem);
- pfree(GinDataLeafPageGetItems(page, &nlist, minItem));
- dataLeafIptrsCount += nlist;
+
+ ptr = GinDataLeafPageGetItems(page, &nlist, minItem);
+
+ if (ptr)
+ {
+ pfree(ptr);
+ dataLeafIptrsCount += nlist;
+ }
+ else
+ emptyDataPages++;
}
else
{
snprintf(res, sizeof(res),
"totalPages: %u\n"
+#if PG_VERSION_NUM >= 100000
+ "deletedPages: %u\n"
+ "emptyDataPages: %u\n"
+#endif
"dataPages: %u\n"
"dataInnerPages: %u\n"
"dataLeafPages: %u\n"
"entryAttrSize: " INT64_FORMAT "\n"
,
totalPages,
+#if PG_VERSION_NUM >= 100000
+ deletedPages,
+ emptyDataPages,
+#endif
dataPages,
dataInnerPages,
dataLeafPages,