From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: David Geier <geidav.pg@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Optimize join selectivity estimation by not reading MCV stats for unique join attributes
Date: Thu, 17 Nov 2022 19:39:30 -0500
Message-ID: <2067066.1668731970@sss.pgh.pa.us> (raw)
In-Reply-To: <2f30ba9c-b707-55ae-0afd-68eb6a8a7708@enterprisedb.com>
References: <b9846ca0-5f1c-9b26-5881-aad3f42b07f0@gmail.com>
<522124.1668179795@sss.pgh.pa.us>
<16acb727-24e8-6453-1711-aae339802966@gmail.com>
<2f30ba9c-b707-55ae-0afd-68eb6a8a7708@enterprisedb.com>
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> Or perhaps what if we have a function that quickly determines if the
> attribute has MCV, without loading it? I'd bet the expensive part of
> get_attstatslot() is the deconstruct_array().
> We could have a function that only does the first small loop over slots,
> and returns true/false if we have a slot of the requested stakind.
Yeah, I like this idea.
> It might even check the isunique flag first, to make it more convenient.
That would tie it to this one use-case, which doesn't seem advisable.
I think we should forget the known-unique angle and just do quick
checks to see if both sides have MCVs.
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, tomas.vondra@enterprisedb.com, geidav.pg@gmail.com
Subject: Re: Optimize join selectivity estimation by not reading MCV stats for unique join attributes
In-Reply-To: <2067066.1668731970@sss.pgh.pa.us>
References: <b9846ca0-5f1c-9b26-5881-aad3f42b07f0@gmail.com> <522124.1668179795@sss.pgh.pa.us> <16acb727-24e8-6453-1711-aae339802966@gmail.com> <2f30ba9c-b707-55ae-0afd-68eb6a8a7708@enterprisedb.com> <2067066.1668731970@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