public inbox for [email protected]  
help / color / mirror / Atom feed
From: David Mullineux <[email protected]>
To: Postgres General <[email protected]>
Subject: Why analyze reports 30000 pages and rows scanned. Why not just rows?
Date: Tue, 19 Aug 2025 11:17:58 +0100
Message-ID: <CAGsyd8UWZr3DiAxTgZqnsJU_LipoL9fhyForcC=B8tzxwEyPLw@mail.gmail.com> (raw)

According to docs, analyze ,by default, will try to sample 30000 rows from
a table.
(I've read analyze.c note about Haas and Stokes IBM Research ).

But my question is, why does 'analyze verbose' report that it has scanned
'30000 of NNNN pages, containing NNNN live rows and 0 dead rows; 30000 rows
in sample,....'

As most tables would store more than 1 row per page, I expected that 30000
rows would require a lot fewer than 30000 *pages* to be scanned.  Why is it
saying it's scanned 30000 pages instead of only 30000 rows ?


Confused. thanks.


view thread (2+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Why analyze reports 30000 pages and rows scanned. Why not just rows?
  In-Reply-To: <CAGsyd8UWZr3DiAxTgZqnsJU_LipoL9fhyForcC=B8tzxwEyPLw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox