From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Mark Dilger <hornschnorter@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Using multiple extended statistics for estimates
Date: Thu, 14 Nov 2019 16:55:41 +0100
Message-ID: <20191114155541.zliellgi2if4bb5f@development> (raw)
In-Reply-To: <2e183f8d-1304-6024-90de-1017a861a235@gmail.com>
References: <20191028152048.jc6pqv5hb7j77ocp@development>
<20191106195440.wtxsyhiwdidl37hv@development>
<20191106195849.odhhc66xd23hw6hf@development>
<97932e1d-53f1-bad3-efc2-1d98cab70727@gmail.com>
<0da76f1f-5f9c-3ce3-3ac6-042d2a18430a@gmail.com>
<20191110173428.w5klequcmb6gawaa@development>
<20191113152823.jdpertc73gfo2mk7@development>
<2e183f8d-1304-6024-90de-1017a861a235@gmail.com>
On Wed, Nov 13, 2019 at 10:04:36AM -0800, Mark Dilger wrote:
>
>
>On 11/13/19 7:28 AM, Tomas Vondra wrote:
>>Hi,
>>
>>here's an updated patch, with some minor tweaks based on the review and
>>added tests (I ended up reworking those a bit, to make them more like
>>the existing ones).
>
>Thanks, Tomas, for the new patch set!
>
>Attached are my review comments so far, in the form of a patch applied
>on top of yours.
>
Thanks.
1) It's not clear to me why adding 'const' to the List parameters would
be useful? Can you explain?
2) I think you're right we can change find_strongest_dependency to do
/* also skip weaker dependencies when attribute count matches */
if (strongest->nattributes == dependency->nattributes &&
strongest->degree >= dependency->degree)
continue;
That'll skip some additional dependencies, which seems OK.
3) It's not clear to me what you mean by
* TODO: Improve this code comment. Specifically, why would we
* ignore that no rows will match? It seems that such a discovery
* would allow us to return an estimate of 0 rows, and that would
* be useful.
added to dependencies_clauselist_selectivity. Are you saying we
should also compute selectivity estimates for individual clauses and
use Min() as a limit? Maybe, but that seems unrelated to the patch.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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: tomas.vondra@2ndquadrant.com, hornschnorter@gmail.com
Subject: Re: Using multiple extended statistics for estimates
In-Reply-To: <20191114155541.zliellgi2if4bb5f@development>
References: <20191028152048.jc6pqv5hb7j77ocp@development> <20191106195440.wtxsyhiwdidl37hv@development> <20191106195849.odhhc66xd23hw6hf@development> <97932e1d-53f1-bad3-efc2-1d98cab70727@gmail.com> <0da76f1f-5f9c-3ce3-3ac6-042d2a18430a@gmail.com> <20191110173428.w5klequcmb6gawaa@development> <20191113152823.jdpertc73gfo2mk7@development> <2e183f8d-1304-6024-90de-1017a861a235@gmail.com> <20191114155541.zliellgi2if4bb5f@development>
* 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