Re: [HACKERS] PATCH: multivariate histograms and MCV lists

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Adrien Nayrat <adrien(dot)nayrat(at)dalibo(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] PATCH: multivariate histograms and MCV lists
Date: 2017-11-25 16:15:05
Message-ID: 0895FFB4-DEB7-459B-ABD2-E7855D0291A8@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Nov 18, 2017, at 12:28 PM, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
>
> Hi,
>
> Attached is an updated version of the patch, adopting the psql describe
> changes introduced by 471d55859c11b.
>
> regards
>
> --
> Tomas Vondra http://www.2ndQuadrant.com
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
> <0001-multivariate-MCV-lists.patch.gz><0002-multivariate-histograms.patch.gz>

Thanks, Tomas, again for your work on this feature.

Applying just the 0001-multivariate-MCV-lists.patch to the current master, and
then extending the stats_ext.sql test as follows, I am able to trigger an error,
"ERROR: operator 4294934272 is not a valid ordering operator".

diff --git a/src/test/regress/sql/stats_ext.sql b/src/test/regress/sql/stats_ext.sql
index e9902ced5c..5083dc05e6 100644
--- a/src/test/regress/sql/stats_ext.sql
+++ b/src/test/regress/sql/stats_ext.sql
@@ -402,4 +402,22 @@ EXPLAIN (COSTS OFF)
EXPLAIN (COSTS OFF)
SELECT * FROM mcv_lists WHERE a IS NULL AND b IS NULL AND c IS NULL;

-RESET random_page_cost;
+DROP TABLE mcv_lists;
+
+CREATE TABLE mcv_lists (
+ a NUMERIC[],
+ b NUMERIC[]
+);
+CREATE STATISTICS mcv_lists_stats (mcv) ON a, b FROM mcv_lists;
+INSERT INTO mcv_lists (a, b)
+ (SELECT array_agg(gs::numeric) AS a, array_agg(gs::numeric) AS b
+ FROM generate_series(1,1000) gs
+ );
+ANALYZE mcv_lists;
+INSERT INTO mcv_lists (a, b)
+ (SELECT array_agg(gs::numeric) AS a, array_agg(gs::numeric) AS b
+ FROM generate_series(1,1000) gs
+ );
+ANALYZE mcv_lists;
+
+DROP TABLE mcv_lists;

Which gives me the following regression.diffs:

*** /Users/mark/master/postgresql/src/test/regress/expected/stats_ext.out 2017-11-25 08:06:37.000000000 -0800
--- /Users/mark/master/postgresql/src/test/regress/results/stats_ext.out 2017-11-25 08:10:18.000000000 -0800
***************
*** 721,724 ****
Index Cond: ((a IS NULL) AND (b IS NULL))
(5 rows)

! RESET random_page_cost;
--- 721,741 ----
Index Cond: ((a IS NULL) AND (b IS NULL))
(5 rows)

! DROP TABLE mcv_lists;
! CREATE TABLE mcv_lists (
! a NUMERIC[],
! b NUMERIC[]
! );
! CREATE STATISTICS mcv_lists_stats (mcv) ON a, b FROM mcv_lists;
! INSERT INTO mcv_lists (a, b)
! (SELECT array_agg(gs::numeric) AS a, array_agg(gs::numeric) AS b
! FROM generate_series(1,1000) gs
! );
! ANALYZE mcv_lists;
! INSERT INTO mcv_lists (a, b)
! (SELECT array_agg(gs::numeric) AS a, array_agg(gs::numeric) AS b
! FROM generate_series(1,1000) gs
! );
! ANALYZE mcv_lists;
! ERROR: operator 4294934272 is not a valid ordering operator
! DROP TABLE mcv_lists;

======================================================================

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-11-25 17:09:54 Re: [HACKERS] More stats about skipped vacuums
Previous Message Robert Haas 2017-11-25 16:10:30 Re: [HACKERS] More stats about skipped vacuums