aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgstattuple/pgstatapprox.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pgstattuple/pgstatapprox.c')
-rw-r--r--contrib/pgstattuple/pgstatapprox.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c
index c84c6423555..04457f4b790 100644
--- a/contrib/pgstattuple/pgstatapprox.c
+++ b/contrib/pgstattuple/pgstatapprox.c
@@ -106,14 +106,7 @@ statapprox_heap(Relation rel, output_type *stat)
page = BufferGetPage(buf);
- /*
- * It's not safe to call PageGetHeapFreeSpace() on new pages, so we
- * treat them as being free space for our purposes.
- */
- if (!PageIsNew(page))
- stat->free_space += PageGetHeapFreeSpace(page);
- else
- stat->free_space += BLCKSZ - SizeOfPageHeaderData;
+ stat->free_space += PageGetExactFreeSpace(page);
/* We may count the page as scanned even if it's new/empty */
scanned++;