Re: Trying to pull up EXPR SubLinks - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: Trying to pull up EXPR SubLinks
Date
Msg-id CAFiTN-sU1uzxMx0WXC4Ss6TcPeV3StK_31euX7fJVb9-wZuVLA@mail.gmail.com
Whole thread Raw
In response to Re: Trying to pull up EXPR SubLinks  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers
On Fri, Apr 24, 2020 at 2:42 PM Andy Fan <zhihui.fan1213@gmail.com> wrote:
>>
>>
>> > 3.  I added the material path in a very hacked way, the if check  just to make
>> > sure it take effect on my test statement only.  If you want to test this patch locally,
>> > you need to change the oid for your case.
>> >
>> > +       if (linitial_node(RangeTblEntry, root->parse->rtable)->relid == 25634)
>> > +               best_path = (Path *) create_material_path(final_rel, best_path);
>>
>> Can we just directly add the material path on top of the best path?  I
>> mean there are possibilities that we might not get any benefit of the
>> material because there is no duplicate from the outer node but we are
>> paying the cost of materialization right?   The correct idea would be
>> that we should select this based on the cost comparison.  Basically,
>> we can consider how many duplicates we have from the outer table
>> variable no?
>
>
> Thanks for interesting of it. Of course we can't add the material path on best path,
> that's why I say it is a  very hacked way.  and say "how to cost this strategy is
> challenge "  (the part you striped when you reply the email).

Right, I see that now.  Thanks for pointing it out.

   But we have to
> test a path first (it must  be helpful on some case at least) and the result is correct,
> then we think about how to cost it. The purpose of my writing is about the first step
> and see what people think about it.

Ok

>
> As for how to cost it,  I'm agreed with your suggestion,  but we may need more
> than that,  like.  (1, 2, 1) and (1, 1, 2) is same for your suggestion, but they
> are not  different in this path.

Valid point.

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andy Fan
Date:
Subject: Re: Trying to pull up EXPR SubLinks
Next
From: David Rowley
Date:
Subject: Re: Trying to pull up EXPR SubLinks