Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-16 Thread Robert Haas
On Mon, Oct 16, 2017 at 2:36 AM, David Rowley wrote: > I personally think it's great we're starting to see a useful feature > materialise that can help with poor row estimates from the planner. I agree. My original post to this thread was more of a throw-away

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-16 Thread David Rowley
On 15 October 2017 at 06:49, Robert Haas wrote: > On Fri, Oct 13, 2017 at 4:49 PM, David Rowley > wrote: >> tps = 8282.481310 (including connections establishing) >> tps = 8282.750821 (excluding connections establishing) > > vs. > >> tps =

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-14 Thread Tomas Vondra
On 10/14/2017 07:49 PM, Robert Haas wrote: > On Fri, Oct 13, 2017 at 4:49 PM, David Rowley > wrote: >> tps = 8282.481310 (including connections establishing) >> tps = 8282.750821 (excluding connections establishing) > > vs. > >> tps = 8520.822410 (including

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-14 Thread Robert Haas
On Fri, Oct 13, 2017 at 4:49 PM, David Rowley wrote: > tps = 8282.481310 (including connections establishing) > tps = 8282.750821 (excluding connections establishing) vs. > tps = 8520.822410 (including connections establishing) > tps = 8521.132784 (excluding

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-14 Thread Robert Haas
On Fri, Oct 13, 2017 at 4:44 PM, Tomas Vondra wrote: > On 10/13/2017 10:04 PM, Robert Haas wrote: >> On Mon, Oct 9, 2017 at 11:03 PM, David Rowley >> wrote: >>> -- Unpatched >>> Planning time: 0.184 ms >>> Execution time: 105.878 ms

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-13 Thread David Rowley
On 14 October 2017 at 09:04, Robert Haas wrote: > On Mon, Oct 9, 2017 at 11:03 PM, David Rowley > wrote: >> -- Unpatched >> Planning time: 0.184 ms >> Execution time: 105.878 ms >> >> -- Patched >> Planning time: 2.175 ms >> Execution

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-13 Thread Tomas Vondra
On 10/13/2017 10:04 PM, Robert Haas wrote: > On Mon, Oct 9, 2017 at 11:03 PM, David Rowley > wrote: >> -- Unpatched >> Planning time: 0.184 ms >> Execution time: 105.878 ms >> >> -- Patched >> Planning time: 2.175 ms >> Execution time: 106.326 ms > > This might

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-13 Thread Robert Haas
On Mon, Oct 9, 2017 at 11:03 PM, David Rowley wrote: > -- Unpatched > Planning time: 0.184 ms > Execution time: 105.878 ms > > -- Patched > Planning time: 2.175 ms > Execution time: 106.326 ms This might not be the best example to show the advantages of the

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-12 Thread David Rowley
On 13 October 2017 at 04:56, Alvaro Herrera wrote: > I pushed your original fix. Thanks for committing -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-12 Thread David Rowley
On 13 October 2017 at 02:17, Alvaro Herrera 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

[HACKERS] Extended statistics is not working on Vars hidden under a RelabelType

2017-10-09 Thread David Rowley
Basically, $subject is causing us not to properly find matching extended stats in this case. The attached patch fixes it. The following test cases is an example of the misbehaviour. Note rows=1 vs rows=98 in the Gather node. create table ab (a varchar, b varchar); insert into ab select