Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1twZDt-00Fd5w-Lm for pgsql-general@arkaria.postgresql.org; Mon, 24 Mar 2025 04:15:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1twZDr-00C3Sc-IY for pgsql-general@arkaria.postgresql.org; Mon, 24 Mar 2025 04:15:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1twZDr-00C3SS-7o for pgsql-general@lists.postgresql.org; Mon, 24 Mar 2025 04:15:35 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twZDp-000mvn-2P for pgsql-general@lists.postgresql.org; Mon, 24 Mar 2025 04:15:34 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-72bd5f25ea6so972255a34.1 for ; Sun, 23 Mar 2025 21:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742789733; x=1743394533; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gi8gY37VgJ4FqqzX1GWmbgYtDNJR8hH4DGx/cqaJhlw=; b=Vul8TBssCJMo3/+6oRWe0Nv2Jnth8GYSy+KU5LosRGdkdFi8hf6suIwWFW/GF0D3tn 3mlt9eft+iO+XbK7p0Wk1wW6lL0cOHrg1FRs0MBaVM4Eq5vTA8uTQrgBJpmXIxxLax/F FriJjFkf9HWy+VX2d9LVuUfKPBvcjdi6xCcjpTcS/wftqaKdWGqgP8i8D4ScwbKQWrJA kHUQfsoBwC9lerFtXttYIRzaBRUNDn7mb921mExM5gcFFq2K+nUKviGzBs7/lObsI9Jc mYAvBsOiN7mmN62MACm9qaNvyJizqOTsdHfZsDPGVAiIMtKZRimS3YiNJrV8t92wjPVi VBRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742789733; x=1743394533; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gi8gY37VgJ4FqqzX1GWmbgYtDNJR8hH4DGx/cqaJhlw=; b=ix9Kh3wCXMtYyvsTwrbYH5EQ0oYr7pX81sd0/HWgEN+O7JU+LI6IaxWtv68irg10cT ZOqoCJa9tSM0TUbs+A+l79q05S7b0BODky6g/g6h6GsXyEIjjl3A+8tuRHtIwwzJevKW z6ThFHKJRA18zr+bDvmGJNyQt1oN9vuSvb10wkQu7rx5NN7SO1n8Kak+5aoIQtumY5ki ltX4n2Hde5te4WIs9LnQUe5V10yZCeOW6NokXsKmiOXBprlUXczdgtb4XSNgJvUlkls7 c3PTDVem65BEeKYLb1RRjmqN4yG6woml97bx5vZjoSODfzCQWMYrvbLoKEmjKPL6rHAz ivMw== X-Gm-Message-State: AOJu0Ywhuz4EuWZ3Ty91VE+DXieUjv5qSpuL9EGP7jsBoCMWgEdKUB0I 3j38yfRJ6nu7Wl4lY8VoKw0QovxVUQhSoXSSSlVC21zsuDFvxr2QOnoQAbg2ZplOp4upWtrbnCQ BhcYDzb0SjD1O4HUYYDzLNRTkUS9MNP5U X-Gm-Gg: ASbGnctku/IqsExvZpe6YTABdCsMaJVmWYtZ5tSwGR7zXYGvuvVbtCug4GqdBmYTAZf ulmE5pTNNvO79JNCUrlEQRaCHvJUrDBhF8gvKHoO/Y/wXcc9KGNzcPd4AQrno0NpappvyLUQB5f JhvFSI934ZT0+fgDAOcl5+2kE+ X-Google-Smtp-Source: AGHT+IG8sKOgfZJ6symHRbZI6JWJCsTOTrSazlbNVCoKeWxGwogKWYJ4KwntDRQs9BzyaEFAHvDvTqadOPrvVa0xJUM= X-Received: by 2002:a05:6808:6b48:b0:3f7:f7b7:88b with SMTP id 5614622812f47-3febf72c7f3mr7155742b6e.21.1742789732717; Sun, 23 Mar 2025 21:15:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:349:0:b0:589:13f9:e937 with HTTP; Sun, 23 Mar 2025 21:15:32 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Sun, 23 Mar 2025 21:15:32 -0700 X-Gm-Features: AQ5f1JraGgEqJvfp5GW9uwtVh4E91_32eWCgeqYp0jwPaMQicgXu0Kq83wwqboo Message-ID: Subject: Re: Best way to check if a table is empty To: Marcelo Fernandes Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000efddf806310edab7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000efddf806310edab7 Content-Type: text/plain; charset="UTF-8" On Sunday, March 23, 2025, David G. Johnston 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. --000000000000efddf806310edab7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 rela= tive 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.=C2=A0 No idea if we take that shortcut.
<= div>
David J.

--000000000000efddf806310edab7--