From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter <pmc@citylink.dinoex.sub.org>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: [Testcase] Queries running forever, because of wrong rowcount estimate
Date: Mon, 13 Feb 2023 12:38:12 -0500
Message-ID: <1265870.1676309892@sss.pgh.pa.us> (raw)
In-Reply-To: <Y+nLjg4Yrnop4hw5@disp.intra.daemon.contact>
References: <Y+nLjg4Yrnop4hw5@disp.intra.daemon.contact>
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.
regards, tom lane
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: tgl@sss.pgh.pa.us, pmc@citylink.dinoex.sub.org
Subject: Re: [Testcase] Queries running forever, because of wrong rowcount estimate
In-Reply-To: <1265870.1676309892@sss.pgh.pa.us>
References: <Y+nLjg4Yrnop4hw5@disp.intra.daemon.contact> <1265870.1676309892@sss.pgh.pa.us>
* 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