From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: New design for FK-based join selectivity estimation
Date: Sat, 18 Jun 2016 15:27:30 -0400
Message-ID: <13294.1466278050@sss.pgh.pa.us> (raw)
In-Reply-To: <15396.1466268742@sss.pgh.pa.us>
References: <31041.1465069446@sss.pgh.pa.us>
<25469.1465138626@sss.pgh.pa.us>
<b790983b-4503-66ff-30c0-e7f46e3ad2f7@2ndquadrant.com>
<15245.1466031608@sss.pgh.pa.us>
<b1648fc3-3fd9-312e-f02c-f7fc6278d7d3@2ndquadrant.com>
<20877.1466175216@sss.pgh.pa.us>
<ee1a76b0-43ed-a6a4-2acb-7c410d0be3ac@2ndquadrant.com>
<15396.1466268742@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
I wrote:
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
>> Is this a good idea? I'd probably vote to do what's proposed (and
>> rejected) in the second half of the comment, i.e. put back the clauses
>> and skip the FK as that pretty much says "improve estimate or keep the
>> current one, but don't risk making it worse."
> I would buy that approach when it comes to "loose" quals, but I think
> it's not right for EC-derived matches, because of the behavior we
> discussed previously that an EC should be considered to have implicitly
> generated all the matching quals even though it actually made only one
> qual that might not be any of them exactly.
After further thought I decided you're right, because one of the main
original goals of ECs was to prevent double-counting the selectivity
of redundant equality quals. Acting as though the EC had generated
multiple redundant quals is likely to make things worse not better.
I still feel that we're leaving something on the table here, but it
would need to take the form of intelligently combining estimates for
overlapping FKs, not just blindly multiplying them together. Seems
like a task for later, especially considering that cases of this sort
are likely to be rare.
Pushed with adjustments for that.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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@2ndquadrant.com
Subject: Re: New design for FK-based join selectivity estimation
In-Reply-To: <13294.1466278050@sss.pgh.pa.us>
References: <31041.1465069446@sss.pgh.pa.us> <25469.1465138626@sss.pgh.pa.us> <b790983b-4503-66ff-30c0-e7f46e3ad2f7@2ndquadrant.com> <15245.1466031608@sss.pgh.pa.us> <b1648fc3-3fd9-312e-f02c-f7fc6278d7d3@2ndquadrant.com> <20877.1466175216@sss.pgh.pa.us> <ee1a76b0-43ed-a6a4-2acb-7c410d0be3ac@2ndquadrant.com> <15396.1466268742@sss.pgh.pa.us> <13294.1466278050@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