Re: PATCH: add support for IN and @> in functional-dependency statistics use

Tomas Vondra <tomas.vondra@2ndquadrant.com>

From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Pierre Ducroquet <p.psql@pinaraf.info>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-03-14T15:21:59Z
Lists: pgsql-hackers
Hi,

I've pushed the first part of the patch, adding ScalarArrayOpExpr as
supported clause for functional dependencies, and then also doing the
same for MCV lists.

As discussed, I'm not going to do anything about the array containment
clauses for PG13, that needs more discussion.

I have a bunch of additional improvements for extended stats, discussed
in [1]. I'll wait a bit for buildfarm and maybe some feedback before
pushing those.


[1] https://www.postgresql.org/message-id/flat/20200113230008.g67iyk4cs3xbnjju@development


regards

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



Commits

  1. Prevent functional dependency estimates from exceeding column estimates.

  2. Recognize some OR clauses as compatible with functional dependencies

  3. Use multi-variate MCV lists to estimate ScalarArrayOpExpr

  4. Use functional dependencies to estimate ScalarArrayOpExpr