Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick from Greenplum: [ORCA] Avoid pushdown of predicate with set-returning function (#14201) #715

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
<dxl:Plan Id="0" SpaceSize="6">
<dxl:GatherMotion InputSegments="0,1,2" OutputSegments="-1">
<dxl:Properties>
<dxl:Cost StartupCost="0" TotalCost="862.000682" Rows="1.000000" Width="16"/>
<dxl:Cost StartupCost="0" TotalCost="862.000660" Rows="1.000000" Width="16"/>
</dxl:Properties>
<dxl:ProjList>
<dxl:ProjElem ColId="18" Alias="x">
Expand All @@ -338,14 +338,11 @@
<dxl:SortingColumnList/>
<dxl:Result>
<dxl:Properties>
<dxl:Cost StartupCost="0" TotalCost="862.000622" Rows="1.000000" Width="16"/>
<dxl:Cost StartupCost="0" TotalCost="862.000600" Rows="1.000000" Width="16"/>
</dxl:Properties>
<dxl:ProjList>
<dxl:ProjElem ColId="18" Alias="x">
<dxl:FuncExpr FuncId="0.1067.1.0" FuncRetSet="true" TypeMdid="0.23.1.0">
<dxl:ConstValue TypeMdid="0.23.1.0" Value="1"/>
<dxl:Ident ColId="1" ColName="b" TypeMdid="0.23.1.0"/>
</dxl:FuncExpr>
<dxl:Ident ColId="18" ColName="x" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
<dxl:ProjElem ColId="0" Alias="a">
<dxl:Ident ColId="0" ColName="a" TypeMdid="0.23.1.0"/>
Expand All @@ -357,19 +354,27 @@
<dxl:Ident ColId="10" ColName="d" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
</dxl:ProjList>
<dxl:Filter/>
<dxl:Filter>
<dxl:Comparison ComparisonOperator="&lt;" OperatorMdid="0.97.1.0">
<dxl:Ident ColId="18" ColName="x" TypeMdid="0.23.1.0"/>
<dxl:ConstValue TypeMdid="0.23.1.0" Value="3"/>
</dxl:Comparison>
</dxl:Filter>
<dxl:OneTimeFilter/>
<dxl:HashJoin JoinType="Inner">
<dxl:Result>
<dxl:Properties>
<dxl:Cost StartupCost="0" TotalCost="862.000583" Rows="1.000000" Width="16"/>
<dxl:Cost StartupCost="0" TotalCost="862.000589" Rows="1.000000" Width="16"/>
</dxl:Properties>
<dxl:ProjList>
<dxl:ProjElem ColId="18" Alias="x">
<dxl:FuncExpr FuncId="0.1067.1.0" FuncRetSet="true" TypeMdid="0.23.1.0">
<dxl:ConstValue TypeMdid="0.23.1.0" Value="1"/>
<dxl:Ident ColId="1" ColName="b" TypeMdid="0.23.1.0"/>
</dxl:FuncExpr>
</dxl:ProjElem>
<dxl:ProjElem ColId="0" Alias="a">
<dxl:Ident ColId="0" ColName="a" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
<dxl:ProjElem ColId="1" Alias="b">
<dxl:Ident ColId="1" ColName="b" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
<dxl:ProjElem ColId="9" Alias="c">
<dxl:Ident ColId="9" ColName="c" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
Expand All @@ -378,16 +383,10 @@
</dxl:ProjElem>
</dxl:ProjList>
<dxl:Filter/>
<dxl:JoinFilter/>
<dxl:HashCondList>
<dxl:Comparison ComparisonOperator="=" OperatorMdid="0.96.1.0">
<dxl:Ident ColId="0" ColName="a" TypeMdid="0.23.1.0"/>
<dxl:Ident ColId="9" ColName="c" TypeMdid="0.23.1.0"/>
</dxl:Comparison>
</dxl:HashCondList>
<dxl:TableScan>
<dxl:OneTimeFilter/>
<dxl:HashJoin JoinType="Inner">
<dxl:Properties>
<dxl:Cost StartupCost="0" TotalCost="431.000069" Rows="1.000000" Width="8"/>
<dxl:Cost StartupCost="0" TotalCost="862.000550" Rows="1.000000" Width="16"/>
</dxl:Properties>
<dxl:ProjList>
<dxl:ProjElem ColId="0" Alias="a">
Expand All @@ -396,35 +395,6 @@
<dxl:ProjElem ColId="1" Alias="b">
<dxl:Ident ColId="1" ColName="b" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
</dxl:ProjList>
<dxl:Filter>
<dxl:Comparison ComparisonOperator="&lt;" OperatorMdid="0.97.1.0">
<dxl:FuncExpr FuncId="0.1067.1.0" FuncRetSet="true" TypeMdid="0.23.1.0">
<dxl:ConstValue TypeMdid="0.23.1.0" Value="1"/>
<dxl:Ident ColId="1" ColName="b" TypeMdid="0.23.1.0"/>
</dxl:FuncExpr>
<dxl:ConstValue TypeMdid="0.23.1.0" Value="3"/>
</dxl:Comparison>
</dxl:Filter>
<dxl:TableDescriptor Mdid="0.81920.1.0" TableName="foo" ExecuteAsUser="10" LockMode="1">
<dxl:Columns>
<dxl:Column ColId="0" Attno="1" ColName="a" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="1" Attno="2" ColName="b" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="2" Attno="-1" ColName="ctid" TypeMdid="0.27.1.0" ColWidth="6"/>
<dxl:Column ColId="3" Attno="-2" ColName="xmin" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="4" Attno="-3" ColName="cmin" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="5" Attno="-4" ColName="xmax" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="6" Attno="-5" ColName="cmax" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="7" Attno="-6" ColName="tableoid" TypeMdid="0.26.1.0" ColWidth="4"/>
<dxl:Column ColId="8" Attno="-7" ColName="gp_segment_id" TypeMdid="0.23.1.0" ColWidth="4"/>
</dxl:Columns>
</dxl:TableDescriptor>
</dxl:TableScan>
<dxl:TableScan>
<dxl:Properties>
<dxl:Cost StartupCost="0" TotalCost="431.000021" Rows="1.000000" Width="8"/>
</dxl:Properties>
<dxl:ProjList>
<dxl:ProjElem ColId="9" Alias="c">
<dxl:Ident ColId="9" ColName="c" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
Expand All @@ -433,21 +403,69 @@
</dxl:ProjElem>
</dxl:ProjList>
<dxl:Filter/>
<dxl:TableDescriptor Mdid="0.81923.1.0" TableName="bar" ExecuteAsUser="10" LockMode="1">
<dxl:Columns>
<dxl:Column ColId="9" Attno="1" ColName="c" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="10" Attno="2" ColName="d" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="11" Attno="-1" ColName="ctid" TypeMdid="0.27.1.0" ColWidth="6"/>
<dxl:Column ColId="12" Attno="-2" ColName="xmin" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="13" Attno="-3" ColName="cmin" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="14" Attno="-4" ColName="xmax" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="15" Attno="-5" ColName="cmax" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="16" Attno="-6" ColName="tableoid" TypeMdid="0.26.1.0" ColWidth="4"/>
<dxl:Column ColId="17" Attno="-7" ColName="gp_segment_id" TypeMdid="0.23.1.0" ColWidth="4"/>
</dxl:Columns>
</dxl:TableDescriptor>
</dxl:TableScan>
</dxl:HashJoin>
<dxl:JoinFilter/>
<dxl:HashCondList>
<dxl:Comparison ComparisonOperator="=" OperatorMdid="0.96.1.0">
<dxl:Ident ColId="0" ColName="a" TypeMdid="0.23.1.0"/>
<dxl:Ident ColId="9" ColName="c" TypeMdid="0.23.1.0"/>
</dxl:Comparison>
</dxl:HashCondList>
<dxl:TableScan>
<dxl:Properties>
<dxl:Cost StartupCost="0" TotalCost="431.000021" Rows="1.000000" Width="8"/>
</dxl:Properties>
<dxl:ProjList>
<dxl:ProjElem ColId="0" Alias="a">
<dxl:Ident ColId="0" ColName="a" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
<dxl:ProjElem ColId="1" Alias="b">
<dxl:Ident ColId="1" ColName="b" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
</dxl:ProjList>
<dxl:Filter/>
<dxl:TableDescriptor Mdid="0.81920.1.0" TableName="foo" ExecuteAsUser="10" LockMode="1">
<dxl:Columns>
<dxl:Column ColId="0" Attno="1" ColName="a" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="1" Attno="2" ColName="b" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="2" Attno="-1" ColName="ctid" TypeMdid="0.27.1.0" ColWidth="6"/>
<dxl:Column ColId="3" Attno="-2" ColName="xmin" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="4" Attno="-3" ColName="cmin" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="5" Attno="-4" ColName="xmax" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="6" Attno="-5" ColName="cmax" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="7" Attno="-6" ColName="tableoid" TypeMdid="0.26.1.0" ColWidth="4"/>
<dxl:Column ColId="8" Attno="-7" ColName="gp_segment_id" TypeMdid="0.23.1.0" ColWidth="4"/>
</dxl:Columns>
</dxl:TableDescriptor>
</dxl:TableScan>
<dxl:TableScan>
<dxl:Properties>
<dxl:Cost StartupCost="0" TotalCost="431.000021" Rows="1.000000" Width="8"/>
</dxl:Properties>
<dxl:ProjList>
<dxl:ProjElem ColId="9" Alias="c">
<dxl:Ident ColId="9" ColName="c" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
<dxl:ProjElem ColId="10" Alias="d">
<dxl:Ident ColId="10" ColName="d" TypeMdid="0.23.1.0"/>
</dxl:ProjElem>
</dxl:ProjList>
<dxl:Filter/>
<dxl:TableDescriptor Mdid="0.81923.1.0" TableName="bar" ExecuteAsUser="10" LockMode="1">
<dxl:Columns>
<dxl:Column ColId="9" Attno="1" ColName="c" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="10" Attno="2" ColName="d" TypeMdid="0.23.1.0" ColWidth="4"/>
<dxl:Column ColId="11" Attno="-1" ColName="ctid" TypeMdid="0.27.1.0" ColWidth="6"/>
<dxl:Column ColId="12" Attno="-2" ColName="xmin" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="13" Attno="-3" ColName="cmin" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="14" Attno="-4" ColName="xmax" TypeMdid="0.28.1.0" ColWidth="4"/>
<dxl:Column ColId="15" Attno="-5" ColName="cmax" TypeMdid="0.29.1.0" ColWidth="4"/>
<dxl:Column ColId="16" Attno="-6" ColName="tableoid" TypeMdid="0.26.1.0" ColWidth="4"/>
<dxl:Column ColId="17" Attno="-7" ColName="gp_segment_id" TypeMdid="0.23.1.0" ColWidth="4"/>
</dxl:Columns>
</dxl:TableDescriptor>
</dxl:TableScan>
</dxl:HashJoin>
</dxl:Result>
</dxl:Result>
</dxl:GatherMotion>
</dxl:Plan>
Expand Down
Loading