Re: Best way to check if a table is empty - Mailing list pgsql-general

From David G. Johnston
Subject Re: Best way to check if a table is empty
Date
Msg-id CAKFQuwbXZ+9tY=graDAWfFaxeOOpdOoQ+JtjmaqWCWfZc-PF4g@mail.gmail.com
Whole thread Raw
In response to Re: Best way to check if a table is empty  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Best way to check if a table is empty
List pgsql-general
On Sunday, March 23, 2025, David G. Johnston <david.g.johnston@gmail.com> wrote:

Maybe IOS helps though I do wonder whether a sequential scan skips over known all-dead pages making that relative benefit go away.

Well, no, since it tracks known visible, not known non-visible, though for something like a fast exists test with no where clause if the VM had any 1 bits the answer to the exists would be yes.  No idea if we take that shortcut.

David J.

pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: Best way to check if a table is empty
Next
From: Christophe Pettus
Date:
Subject: Re: Best way to check if a table is empty