Rahul Challapalli created DRILL-5149:
----------------------------------------
Summary: Planner Optimization : Filter should get pushed into the
sub-query
Key: DRILL-5149
URL: https://issues.apache.org/jira/browse/DRILL-5149
Project: Apache Drill
Issue Type: Bug
Components: Query Planning & Optimization
Affects Versions: 1.10.0
Reporter: Rahul Challapalli
git.commit.id.abbrev=cf2b7c7
The below plan can be optimized to push the filter into the subquery and also
to eliminate redundant projects
{code}
explain plan for select * from (select * from
dfs.`/drill/testdata/resource-manager/5kwidecolumns_500k.tbl` order by
columns[0]) d where d.columns[0] = '4041054511';
00-00 Screen : rowType = RecordType(ANY *): rowcount = 1.436392845E7,
cumulative cost = {8.776360282950001E8 rows, 1.4059092422298168E10 cpu, 0.0 io,
1.96115503104E12 network, 1.532152368E9 memory}, id = 11452
00-01 Project(*=[$0]) : rowType = RecordType(ANY *): rowcount =
1.436392845E7, cumulative cost = {8.7619963545E8 rows, 1.4057656029453169E10
cpu, 0.0 io, 1.96115503104E12 network, 1.532152368E9 memory}, id = 11451
00-02 SelectionVectorRemover : rowType = RecordType(ANY T18¦¦*):
rowcount = 1.436392845E7, cumulative cost = {8.7619963545E8 rows,
1.4057656029453169E10 cpu, 0.0 io, 1.96115503104E12 network, 1.532152368E9
memory}, id = 11450
00-03 Filter(condition=[=(ITEM(ITEM($0, 'columns'), 0),
'4041054511')]) : rowType = RecordType(ANY T18¦¦*): rowcount = 1.436392845E7,
cumulative cost = {8.61835707E8 rows, 1.4043292101003168E10 cpu, 0.0 io,
1.96115503104E12 network, 1.532152368E9 memory}, id = 11449
00-04 Project(T18¦¦*=[$0]) : rowType = RecordType(ANY T18¦¦*):
rowcount = 9.5759523E7, cumulative cost = {7.66076184E8 rows,
1.3602798295203169E10 cpu, 0.0 io, 1.96115503104E12 network, 1.532152368E9
memory}, id = 11448
00-05 SingleMergeExchange(sort0=[1 ASC]) : rowType =
RecordType(ANY T18¦¦*, ANY EXPR$1): rowcount = 9.5759523E7, cumulative cost =
{7.66076184E8 rows, 1.3602798295203169E10 cpu, 0.0 io, 1.96115503104E12
network, 1.532152368E9 memory}, id = 11447
01-01 SelectionVectorRemover : rowType = RecordType(ANY T18¦¦*,
ANY EXPR$1): rowcount = 9.5759523E7, cumulative cost = {6.70316661E8 rows,
1.2836722111203169E10 cpu, 0.0 io, 1.176693018624E12 network, 1.532152368E9
memory}, id = 11446
01-02 Sort(sort0=[$1], dir0=[ASC]) : rowType = RecordType(ANY
T18¦¦*, ANY EXPR$1): rowcount = 9.5759523E7, cumulative cost = {5.74557138E8
rows, 1.2740962588203169E10 cpu, 0.0 io, 1.176693018624E12 network,
1.532152368E9 memory}, id = 11445
01-03 Project(T18¦¦*=[$0], EXPR$1=[$1]) : rowType =
RecordType(ANY T18¦¦*, ANY EXPR$1): rowcount = 9.5759523E7, cumulative cost =
{4.78797615E8 rows, 2.585507121E9 cpu, 0.0 io, 1.176693018624E12 network, 0.0
memory}, id = 11444
01-04 HashToRandomExchange(dist0=[[$1]]) : rowType =
RecordType(ANY T18¦¦*, ANY EXPR$1, ANY E_X_P_R_H_A_S_H_F_I_E_L_D): rowcount =
9.5759523E7, cumulative cost = {4.78797615E8 rows, 2.585507121E9 cpu, 0.0 io,
1.176693018624E12 network, 0.0 memory}, id = 11443
02-01 UnorderedMuxExchange : rowType = RecordType(ANY
T18¦¦*, ANY EXPR$1, ANY E_X_P_R_H_A_S_H_F_I_E_L_D): rowcount = 9.5759523E7,
cumulative cost = {3.83038092E8 rows, 1.053354753E9 cpu, 0.0 io, 0.0 network,
0.0 memory}, id = 11442
03-01 Project(T18¦¦*=[$0], EXPR$1=[$1],
E_X_P_R_H_A_S_H_F_I_E_L_D=[hash32AsDouble($1)]) : rowType = RecordType(ANY
T18¦¦*, ANY EXPR$1, ANY E_X_P_R_H_A_S_H_F_I_E_L_D): rowcount = 9.5759523E7,
cumulative cost = {2.87278569E8 rows, 9.5759523E8 cpu, 0.0 io, 0.0 network, 0.0
memory}, id = 11441
03-02 Project(T18¦¦*=[$0], EXPR$1=[ITEM($1, 0)]) :
rowType = RecordType(ANY T18¦¦*, ANY EXPR$1): rowcount = 9.5759523E7,
cumulative cost = {1.91519046E8 rows, 5.74557138E8 cpu, 0.0 io, 0.0 network,
0.0 memory}, id = 11440
03-03 Project(T18¦¦*=[$0], columns=[$1]) : rowType
= RecordType(ANY T18¦¦*, ANY columns): rowcount = 9.5759523E7, cumulative cost
= {9.5759523E7 rows, 1.91519046E8 cpu, 0.0 io, 0.0 network, 0.0 memory}, id =
11439
03-04 Scan(groupscan=[EasyGroupScan
[selectionRoot=maprfs:/drill/testdata/resource-manager/5kwidecolumns_500k.tbl,
numFiles=1, columns=[`*`],
files=[maprfs:///drill/testdata/resource-manager/5kwidecolumns_500k.tbl]]]) :
rowType = (DrillRecordRow[*, columns]): rowcount = 9.5759523E7, cumulative cost
= {9.5759523E7 rows, 1.91519046E8 cpu, 0.0 io, 0.0 network, 0.0 memory}, id =
11438
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)