Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6615

To prevent the limit operator after topN operator if there is a single fragment

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.14.0
    • None
    • None
    • None

    Description

      The limit operator is called after topN operator which is not needed if u have only 1 fragment .

      For eg :- 

      
      00-00 Screen : rowType = RecordType(ANY c_custkey, ANY c_name, ANY EXPR$2, ANY EXPR$3): rowcount = 50.0, cumulative cost = \{116621.0 rows, 2787624.201857771 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7854 00-01 Project(c_custkey=[$0], c_name=[$1], EXPR$2=[$2], EXPR$3=[$3]) : rowType = RecordType(ANY c_custkey, ANY c_name, ANY EXPR$2, ANY EXPR$3): rowcount = 50.0, cumulative cost = \{116616.0 rows, 2787619.201857771 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7853 00-02 SelectionVectorRemover : rowType = RecordType(ANY c_custkey, ANY c_name, ANY ITEM, ANY ITEM1): rowcount = 50.0, cumulative cost = \{116566.0 rows, 2787419.201857771 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7852 00-03 Limit(fetch=[50]) : rowType = RecordType(ANY c_custkey, ANY c_name, ANY ITEM, ANY ITEM1): rowcount = 50.0, cumulative cost = \{116516.0 rows, 2787369.201857771 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7851 00-04 SelectionVectorRemover : rowType = RecordType(ANY c_custkey, ANY c_name, ANY ITEM, ANY ITEM1): rowcount = 29116.0, cumulative cost = \{116466.0 rows, 2787169.201857771 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7850 00-05 TopN(limit=[50]) : rowType = RecordType(ANY c_custkey, ANY c_name, ANY ITEM, ANY ITEM1): rowcount = 29116.0, cumulative cost = \{87350.0 rows, 2758053.201857771 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7849 00-06 LateralJoin(correlation=[$cor2], joinType=[inner], requiredColumns=[\{0}], column excluded from output: =[`c_orders`]) : rowType = RecordType(ANY c_custkey, ANY c_name, ANY ITEM, ANY ITEM1): rowcount = 29116.0, cumulative cost = \{58234.0 rows, 786135.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7848 00-08 Scan(groupscan=[EasyGroupScan [selectionRoot=maprfs:/drill/testdata/lateralUnnest/sf0dot01/json/customer, numFiles=1, columns=[`c_orders`, `c_custkey`, `c_name`], files=[maprfs:///drill/testdata/lateralUnnest/sf0dot01/json/customer/customer.json]]]) : rowType = RecordType(ANY c_orders, ANY c_custkey, ANY c_name): rowcount = 29116.0, cumulative cost = \{29116.0 rows, 87348.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7846 00-07 Project(ITEM=[ITEM($0, 'o_orderkey')], ITEM1=[ITEM($0, 'o_totalprice')]) : rowType = RecordType(ANY ITEM, ANY ITEM1): rowcount = 1.0, cumulative cost = \{2.0 rows, 3.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7847 00-09 Unnest [srcOp=00-06] : rowType = RecordType(ANY c_orders): rowcount = 1.0, cumulative cost = \{1.0 rows, 1.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7700
      
      

      Attachments

        1. topnNlimit.pdf
          23 kB
          Kedar Sankar Behera

        Activity

          People

            shamirwasia Sorabh Hamirwasia
            kedar.behera Kedar Sankar Behera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: