Re: Additional improvements to extended statistics

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Additional improvements to extended statistics
Date: 2020-03-14 16:56:10
Message-ID: 20200314165610.s7p2mgaishsujq5s@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 13, 2020 at 04:54:51PM +0000, Dean Rasheed wrote:
>On Mon, 9 Mar 2020 at 00:06, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
>>
>> On Mon, Mar 09, 2020 at 01:01:57AM +0100, Tomas Vondra wrote:
>> >
>> >Attaches is an updated patch series
>> >with parts 0002 and 0003 adding tests demonstrating the issue and then
>> >fixing it (both shall be merged to 0001).
>> >
>>
>> One day I won't forget to actually attach the files ...
>>
>
>0001-0003 look reasonable to me.
>
>One minor point -- there are now 2 code blocks that are basically the
>same, looping over a list of clauses, calling clause_selectivity() and
>then applying the "s1 = s1 + s2 - s1 * s2" formula. Perhaps they could
>be combined into a new function (clauselist_selectivity_simple_or(),
>say). I guess it would need to be passed the initial starting
>selectivity s1, but it ought to help reduce code duplication.
>

Attached is a patch series rebased on top of the current master, after
committing the ScalarArrayOpExpr enhancements. I've updated the OR patch
to get rid of the code duplication, and barring objections I'll get it
committed shortly together with the two parts improving test coverage.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Improve-test-coverage-for-multi-column-MCV--20200314.patch text/plain 24.7 KB
0002-Improve-estimation-of-OR-clauses-with-exten-20200314.patch text/plain 19.9 KB
0003-Improve-test-coverage-for-functional-depend-20200314.patch text/plain 6.0 KB
0004-Support-clauses-of-the-form-Var-op-Var-20200314.patch text/plain 17.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2020-03-14 17:27:33 Re: Planning counters in pg_stat_statements (using pgss_store)
Previous Message James Coleman 2020-03-14 16:36:17 Re: [PATCH] Incremental sort (was: PoC: Partial sort)