Re: Expr. extended stats are skipped with equality operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Danny Shemesh <dany74q(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Subject: Re: Expr. extended stats are skipped with equality operator
Date: 2022-08-05 18:08:18
Message-ID: 2330.1659722898@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> A reproducer for this:

> CREATE TABLE t1(x int[], y float);
> INSERT INTO t1 SELECT array[1], a FROM generate_series(1,99)a;
> CREATE STATISTICS s2 ON (CASE x[1] WHEN 1 THEN true ELSE false END), y FROM t1;
> ANALYZE t1;

> explain analyze SELECT * FROM t1 WHERE CASE x[1] WHEN 1 THEN true ELSE false END AND y=1;
> ERROR: unknown clause type: 134

Sigh ... this is just horrid. I think I see what to do about it though,
and since Tomas seems to have been AWOL for awhile now, I don't think
we'll get a fix by Monday if we wait for him. I'll take a shot at
fixing it; it seems unlikely that I can make it worse.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2022-08-05 19:02:12 Re: Proposal: Support custom authentication methods using hooks
Previous Message Robert Treat 2022-08-05 18:02:19 Re: [doc] fix a potential grammer mistake