From: Peter <pmc@citylink.dinoex.sub.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: [Testcase] Queries running forever, because of wrong rowcount estimate
Date: Mon, 13 Feb 2023 19:18:13 +0100
Message-ID: <Y+p+5fNZqzosknBf@disp.intra.daemon.contact> (raw)
In-Reply-To: <1265870.1676309892@sss.pgh.pa.us>
References: <Y+nLjg4Yrnop4hw5@disp.intra.daemon.contact>
<1265870.1676309892@sss.pgh.pa.us>
On Mon, Feb 13, 2023 at 12:38:12PM -0500, Tom Lane wrote:
! Peter <pmc@citylink.dinoex.sub.org> writes:
! > "rows=1" in the "Hash Anti Join" line is WRONG. It should be
! > 3000000. Or at least some thousands.
!
! FWIW, this behaves better in v14 and up. In older versions there's
! an ambiguity about what relpages=reltuples=0 means; it's the state
! when ANALYZE has never yet examined the table contents, but it's
! also the state when we have found the table to be empty. Because
! of the former case, older planner versions don't like to believe
! that a table is empty even if reltuples says so.
Thanks, Tom, I found that as change 3d351d916b2 - that should
make the issue more unlikely and not so prone to happen during
testing.
OTOH, that code did apparently not do anything evil that would
not be possible to happen under other circumstances. It's unlikely,
because one would at some point change such queries to a more
performant style, but I am currently trying to understand why
it can happen at all...
cheers,
PMc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pmc@citylink.dinoex.sub.org, tgl@sss.pgh.pa.us
Subject: Re: [Testcase] Queries running forever, because of wrong rowcount estimate
In-Reply-To: <Y+p+5fNZqzosknBf@disp.intra.daemon.contact>
References: <Y+nLjg4Yrnop4hw5@disp.intra.daemon.contact> <1265870.1676309892@sss.pgh.pa.us> <Y+p+5fNZqzosknBf@disp.intra.daemon.contact>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox