Re: Incorrect estimation of HashJoin rows resulted from inaccurate small table statistics

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Quan Zongliang <quanzongliang(at)yeah(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incorrect estimation of HashJoin rows resulted from inaccurate small table statistics
Date: 2023-06-17 11:48:39
Message-ID: bc6251af-266a-1a42-d069-29cbf5a1cd8a@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/17/23 00:32, Quan Zongliang wrote:
> ...
>
> It's not just a small table. If a column's value is nearly unique. It
> also causes the same problem because we exclude values that occur only
> once. samplerows <= num_mcv just solves one scenario.
> Perhaps we should discard this (dups cnt > 1) restriction?
>

But for larger tables we'll be unable to keep all the values in the MCV.
So I think this only can change things for tiny tables.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2023-06-17 13:34:24 Re: Deleting prepared statements from libpq.
Previous Message Amit Kapila 2023-06-17 09:44:51 Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases