Re: VACUUM vs VACUUM FULL (was: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches) - Mailing list pgsql-general

From Tom Lane
Subject Re: VACUUM vs VACUUM FULL (was: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches)
Date
Msg-id 1402526.1675277762@sss.pgh.pa.us
Whole thread Raw
In response to Re: VACUUM vs VACUUM FULL (was: SELECT * FROM huge_table LIMIT 10; Why does it take more than 10 min to complete, with cold caches)  (Christophe Pettus <xof@thebuild.com>)
List pgsql-general
Christophe Pettus <xof@thebuild.com> writes:
>> On Feb 1, 2023, at 10:45, David G. Johnston <david.g.johnston@gmail.com> wrote:
>> The system just isn't that intelligent for "sequential scan", instead it does literally what the label says, goes
throughthe table one page at a time and returns any live rows it finds.  

> Although this does raise a question: Couldn't it skip pages that are marked appropriately in the visibility map?

There's no bit in the visibility map for "contains no live tuples".
I think adding one would be optimizing for the wrong thing.

(You might be thinking of the free-space map, but we don't maintain
that rigorously enough to trust it as a guide to skipping pages.)

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Best Open Source OS for Postgresql
Next
From: Ron
Date:
Subject: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?