Christophe Pettus <x...@thebuild.com> writes: >> On Feb 1, 2023, at 10:45, David G. Johnston <david.g.johns...@gmail.com> >> wrote: >> The system just isn't that intelligent for "sequential scan", instead it >> does literally what the label says, goes through the 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