pgsql: Improve test coverage for multi-column MCV lists

2020-03-14 Thread Tomas Vondra
Improve test coverage for multi-column MCV lists The regression tests for extended statistics were not testing a couple of important cases for the MCV lists: * IS NOT NULL clauses - We did have queries with IS NULL clauses, but not the negative case. * clauses with variable on the right

pgsql: Improve test coverage for functional dependencies

2020-03-14 Thread Tomas Vondra
Improve test coverage for functional dependencies The regression tests for functional dependencies were only using clauses of the form (Var op Const), i.e. with Var on the left side. This adds a couple of queries with Var on the right, to test other code paths. It also prints one of the functiona

pgsql: C comment: correct commented bytes of max_cached_tuplebufs

2020-03-14 Thread Bruce Momjian
C comment: correct commented bytes of max_cached_tuplebufs The comment said ~8MB, but it is actually ~64MB. Reported-by: Kuntal Ghosh Discussion: https://postgr.es/m/cagz5qc+ggmhdnxp04b6wclz2zcd_hu+wcbrspyozp62-bjg...@mail.gmail.com Backpatch-through: 9.5-10 Branch -- REL_10_STABLE Deta

pgsql: C comment: correct commented bytes of max_cached_tuplebufs

2020-03-14 Thread Bruce Momjian
C comment: correct commented bytes of max_cached_tuplebufs The comment said ~8MB, but it is actually ~64MB. Reported-by: Kuntal Ghosh Discussion: https://postgr.es/m/cagz5qc+ggmhdnxp04b6wclz2zcd_hu+wcbrspyozp62-bjg...@mail.gmail.com Backpatch-through: 9.5-10 Branch -- REL9_6_STABLE Deta

pgsql: C comment: correct commented bytes of max_cached_tuplebufs

2020-03-14 Thread Bruce Momjian
C comment: correct commented bytes of max_cached_tuplebufs The comment said ~8MB, but it is actually ~64MB. Reported-by: Kuntal Ghosh Discussion: https://postgr.es/m/cagz5qc+ggmhdnxp04b6wclz2zcd_hu+wcbrspyozp62-bjg...@mail.gmail.com Backpatch-through: 9.5-10 Branch -- REL9_5_STABLE Deta

pgsql: Rearrange pseudotypes.c to get rid of duplicative code.

2020-03-14 Thread Tom Lane
Rearrange pseudotypes.c to get rid of duplicative code. Commit a5954de10 replaced a lot of manually-coded stub I/O routines with code generated by macros. That was a good idea but it didn't go far enough, because there were still manually-coded stub input routines for types that had live output r

pgsql: Restructure polymorphic-type resolution in funcapi.c.

2020-03-14 Thread Tom Lane
Restructure polymorphic-type resolution in funcapi.c. resolve_polymorphic_tupdesc() and resolve_polymorphic_argtypes() failed to cover the case of having to resolve anyarray given only an anyrange input. The bug was masked if anyelement was also used (as either input or output), which probably hel

pgsql: Restructure polymorphic-type resolution in funcapi.c.

2020-03-14 Thread Tom Lane
Restructure polymorphic-type resolution in funcapi.c. resolve_polymorphic_tupdesc() and resolve_polymorphic_argtypes() failed to cover the case of having to resolve anyarray given only an anyrange input. The bug was masked if anyelement was also used (as either input or output), which probably hel

pgsql: Restructure polymorphic-type resolution in funcapi.c.

2020-03-14 Thread Tom Lane
Restructure polymorphic-type resolution in funcapi.c. resolve_polymorphic_tupdesc() and resolve_polymorphic_argtypes() failed to cover the case of having to resolve anyarray given only an anyrange input. The bug was masked if anyelement was also used (as either input or output), which probably hel

pgsql: Restructure polymorphic-type resolution in funcapi.c.

2020-03-14 Thread Tom Lane
Restructure polymorphic-type resolution in funcapi.c. resolve_polymorphic_tupdesc() and resolve_polymorphic_argtypes() failed to cover the case of having to resolve anyarray given only an anyrange input. The bug was masked if anyelement was also used (as either input or output), which probably hel

pgsql: Restructure polymorphic-type resolution in funcapi.c.

2020-03-14 Thread Tom Lane
Restructure polymorphic-type resolution in funcapi.c. resolve_polymorphic_tupdesc() and resolve_polymorphic_argtypes() failed to cover the case of having to resolve anyarray given only an anyrange input. The bug was masked if anyelement was also used (as either input or output), which probably hel

pgsql: Restructure polymorphic-type resolution in funcapi.c.

2020-03-14 Thread Tom Lane
Restructure polymorphic-type resolution in funcapi.c. resolve_polymorphic_tupdesc() and resolve_polymorphic_argtypes() failed to cover the case of having to resolve anyarray given only an anyrange input. The bug was masked if anyelement was also used (as either input or output), which probably hel

pgsql: Use multi-variate MCV lists to estimate ScalarArrayOpExpr

2020-03-14 Thread Tomas Vondra
Use multi-variate MCV lists to estimate ScalarArrayOpExpr Commit 8f321bd16c added support for estimating ScalarArrayOpExpr clauses (IN/ANY) clauses using functional dependencies. There's no good reason not to support estimation of these clauses using multi-variate MCV lists too, so this commits im

pgsql: Use functional dependencies to estimate ScalarArrayOpExpr

2020-03-14 Thread Tomas Vondra
Use functional dependencies to estimate ScalarArrayOpExpr Until now functional dependencies supported only simple equality clauses and clauses that can be trivially translated to equalities. This commit allows estimation of some ScalarArrayOpExpr (IN/ANY) clauses. For IN clauses we can do this th