Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      Optimize ProjectMergeRule to use RelOptUtil.pushPastProject rather than creating two RexPrograms and merging them. The current approach generates a lot of gc pressure.

      One side effect will be to remove some identity projects. ProjectMergeRule currently refuses to reduce identity projects if the fields have different names.

      For instance suppose you have a table Dept (deptno, name) and the algebra

        2: Project($1 as X, $0 as Y)
          1: Project($1, $0)
            0: Scan(Dept)
      

      Observe that if you combine projects #1 and #2 you end up with

        3: Project($0 as X, $1 as Y)
          0: Scan(Dept)
      

      Although the new project (#3) is an identity, it renames the fields. ProjectMergeRule will return the new project (#3), but it could return Scan(Dept) (#0). I think the latter is better, so that will be the new behavior.

        Activity

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/b550ff88 .
        Hide
        julianhyde Julian Hyde added a comment -

        Note that if you want the old behavior, rather than using ProjectMergeRule.INSTANCE, you should create your own instance with force = false:

        new ProjectMergeRule(false, RelFactories.DEFAULT_PROJECT_FACTORY)
        Show
        julianhyde Julian Hyde added a comment - Note that if you want the old behavior, rather than using ProjectMergeRule.INSTANCE, you should create your own instance with force = false: new ProjectMergeRule( false , RelFactories.DEFAULT_PROJECT_FACTORY)
        Hide
        jnadeau Jacques Nadeau added a comment -

        Resolved in release 1.4.0-incubating (2015-08-23)

        Show
        jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development