|From:||Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>|
|To:||Pierre Ducroquet <p(dot)psql(at)pinaraf(dot)info>|
|Subject:||Re: PATCH: add support for IN and @> in functional-dependency statistics use|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
I've looked at this patch series, hoping to get it close to committable.
Here is a somewhat improved version of the patch series, split into 5
pieces. The first 4 parts are about applying functional dependencies to
ScalarArrayOpExpr clauses. The last part is about doing the same thing
for MCV lists, so it seemed fine to post it here.
0001 is the patch you posted back in October
0002 simplifies the handling logic a bit, because ScalarArrayOpExpr can
only have form (Var op Const) but not (Const op Var).
0003 fixes what I think is a bug - ScalarArrayOpExpr can represent three
* Var op ANY ()
* Var IN () -- special case of ANY
* Var op ALL ()
I don't think functional dependencies can handle the ALL case, we need
to reject it by checking the useOr flag.
0004 adds queries to the stats_ext test suite, to test all of this (some
of the cases illustrate the need for 0003, I think)
0005 allows estimation of ScalarArrayOpExpr by MCV lists, including
regression tests etc.
Will you have time to look at this, particularly 0001-0004, but maybe
even the 0005 part?
As for the second part of your patch (the one allowing estimation of
array containment queries), I still think that's not something we can
reasonably do without also building statistics on elements (which is
what we have in pg_stats but not pg_stats_ext).
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
|Next Message||Kyotaro Horiguchi||2020-03-05 03:08:41||Re: Crash by targetted recovery|
|Previous Message||Peter Geoghegan||2020-03-05 01:13:33||kill_prior_tuple and index scan costing|