| From: | Sai Sadashiva Kundurmutt <saisadashiva2000(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | pgsql-admin(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Are the estimates made for number of pages accurate |
| Date: | 2024-02-26 03:59:04 |
| Message-ID: | CAH6hFGKBBqKX7HSi9+guMUcn7h_ELQUQKkwCu3N8ug-=xi02+g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
Thank you for clearing my doubts.
On Sun, 25 Feb 2024 at 22:11, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Sai Sadashiva Kundurmutt <saisadashiva2000(at)gmail(dot)com> writes:
> > I wanted to know whether the numbers calculated by ANALYZE for number of
> > pages are exact(the relpages field in pg_class).
>
> If memory serves, relpages is accurate as of the time of the last
> VACUUM or ANALYZE on the table, but of course it could be arbitrarily
> out of date later.
>
> > I had the impression that
> > it is exact because during random sampling the number of pages is
> assumed
> > to be known.
>
> What makes you think that? And even more to the point, what makes
> you think that we'd rely on relpages for such a purpose? I'd expect
> a fresh RelationGetNumberOfBlocks call in any scan that had a need
> to know the table size.
>
> regards, tom lane
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | SOzcn | 2024-02-26 08:43:48 | Google Cloud Maintenance |
| Previous Message | Ron Johnson | 2024-02-26 00:02:50 | Re: Another way to do audit in DML operations in PostgreSQL >= 14 |