Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5451

Column pruning for Subselect

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.14.2
    • 4.15.0, 5.1.0
    • None
    • None

    Description

      Phoenix has already could prune column for single flat table query, but for subselect in subquery or join, column pruning is not implemented.

      Consider following join sql :

      select  a.aid,b.bid from 
       (select aid,age from table1 where age >=11 and age<=33 order by age limit 3) a inner join 
       (select bid,code from table2 order by code limit 1) b on a.aid=b.bid 
       

      for LHS, table1.age is not referenced by outer join, and for RHS, table2.code is also not referenced by outer join, table1.age and table2.code could both be pruned when executing query for LHS and RHS, but now Phoenix does not prune them.

      Another example is subquery sql:

      SELECT t.eid id,  t.bstr b FROM 
      (SELECT entity_id eid, a_string astr, b_string bstr  FROM table  WHERE a_byte + 1 < 9 limit 2)  t ORDER BY b,id
      

      for inner subselect sql, a_string is never used by outer sql, so a_string could be pruned when executing query for inner subselect, but now Phoenix does not prune it.

      Some existing test cases could be optimized by this patch.

      Attachments

        Issue Links

          Activity

            People

              comnetwork chenglei
              comnetwork chenglei
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m