Re: Best way to check if a table is empty

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Marcelo Fernandes <marcefern7(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Best way to check if a table is empty
Date: 2025-03-24 04:15:32
Message-ID: CAKFQuwbXZ+9tY=graDAWfFaxeOOpdOoQ+JtjmaqWCWfZc-PF4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday, March 23, 2025, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2025-03-24 04:16:31 Re: Best way to check if a table is empty
Previous Message Christophe Pettus 2025-03-24 04:14:15 Re: Best way to check if a table is empty