Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType - Mailing list pgsql-hackers

From David Rowley
Subject Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType
Date
Msg-id CAKJS1f-89Yh-ZiaCK5YVEUu+TDNK058r3JAfL8N-dws_L84PEg@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Re: Extended statistics is not working on Vars hidden under aRelabelType  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses [HACKERS] Re: Extended statistics is not working on Vars hidden under aRelabelType
List pgsql-hackers
On 13 October 2017 at 02:17, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> I propose this slightly larger change.

hmm, this is not right. You're not checking that there's a Var below
the RelabelType.

I tried with:

explain select * from ab where (a||a)::varchar = '' and b = '';

and your code assumed the OpExpr was a Var.

The reason Tomas coded it the way it was coded is due to the fact that
there's already code that works exactly the same way in
clauselist_selectivity(). Personally, I don't particularly like that
code, but I'd rather not invent a new way to do the same thing.


-- David Rowley                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: [HACKERS] Re: Extended statistics is not working on Vars hidden under aRelabelType
Next
From: Amit Kapila
Date:
Subject: [HACKERS] BLK_DONE state in XLogReadBufferForRedoExtended