Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently optiq does not push projects through WindowRel, thus it feeds excessive data to WindowRel.

      select *
        from (
          select "empid", "deptno", count(*) over (partition by "deptno") c
            from "hr"."emps"
       )
       where "deptno"=10 and "empid"=100

      Optiq should recognize it is required to track just fields empid and deptno.

      However the java code is as follows (note that empid, name, salary, and commission are projected):

      /*  47 */       _list.add(new Object[] {
      /*  48 */         row.empid,
      /*  49 */         row.deptno,
      /*  50 */         row.name,
      /*  51 */         row.salary,
      /*  52 */         row.commission,
      /*  53 */         COUNTa0w0});
      

        Activity

        Hide
        vladimirsitnikov Vladimir Sitnikov added a comment - - edited

        Sorry, I am not following you.
        Can you please show the sample of the test you are talking about?
        I find no tests like *trim*.

        In the PR I add tests that validate that unnecessary fields get trimmed, however that is done via CalcRelSplitter machinery.

        Show
        vladimirsitnikov Vladimir Sitnikov added a comment - - edited Sorry, I am not following you. Can you please show the sample of the test you are talking about? I find no tests like *trim* . In the PR I add tests that validate that unnecessary fields get trimmed, however that is done via CalcRelSplitter machinery.
        Hide
        julianhyde Julian Hyde added a comment - - edited

        I'll take a look at that pull request.

        But can you also check that RelFieldTrimmer does the right thing when windowed aggregations are present, and add a test if there is not one. If unused fields are removed at an early stage, then other missing rules will not be too serious.

        Create a new jira case for this task if necessary.

        Show
        julianhyde Julian Hyde added a comment - - edited I'll take a look at that pull request. But can you also check that RelFieldTrimmer does the right thing when windowed aggregations are present, and add a test if there is not one. If unused fields are removed at an early stage, then other missing rules will not be too serious. Create a new jira case for this task if necessary.
        Hide
        vladimirsitnikov Vladimir Sitnikov added a comment -

        It looks like there's a simple solution: ensure the first "CalcRelSplitter level" is CalcRelType, that triggers projection optimization and results in the desired plan without new rules.
        See https://github.com/julianhyde/optiq/pull/307

        Show
        vladimirsitnikov Vladimir Sitnikov added a comment - It looks like there's a simple solution: ensure the first "CalcRelSplitter level" is CalcRelType, that triggers projection optimization and results in the desired plan without new rules. See https://github.com/julianhyde/optiq/pull/307

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            vladimirsitnikov Vladimir Sitnikov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development