Multivariate MCV lists -- pg_mcv_list_items() seems to be broken

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Subject: Multivariate MCV lists -- pg_mcv_list_items() seems to be broken
Date: 2019-04-15 16:02:43
Message-ID: CAEZATCX6T0iDTTZrqyec4Cd6b4yuL7euu4=rQRXaVBAVrUi1Cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I just noticed the following:

CREATE TABLE foo (a int, b int);
INSERT INTO foo SELECT x/10, x/100 FROM generate_series(1, 100) x;
CREATE STATISTICS foo_s ON a,b FROM foo;
ANALYSE foo;

SELECT pg_mcv_list_items(stxmcv) from pg_statistic_ext WHERE stxname = 'foo_s';

which fails with

ERROR: cache lookup failed for type 0

That definitely used to work, so I'm guessing it got broken by the
recent reworking of the serialisation code, but I've not looked into
it.

There should probably be regression test coverage of that function.

Regards,
Dean

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-15 16:07:25 Re: plpgsql - execute - cannot use a reference to record field
Previous Message Tom Lane 2019-04-15 15:10:38 Re: Zedstore - compressed in-core columnar storage