Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1465

Store constants as a derived field in RelOptPredicateList

    Details

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

      Description

      I propose that we compute predicate constants when we create a RelOptPredicateList, and store them in an immutable field constantMap.

      Currently, any rule that wishes to detect constants by aliasing (e.g. if we know x = 5 and x = y then we can deduce y = 5) must start with a RelOptPredicateList (from the metadata supplier) and call the ReduceExpressionsRule.predicateConstants method. This method is called many times: in the current Calcite suite 1,201 instances of RelOptPredicateList are created and predicateConstants is called 82,670 times.

      Pre-computing would use a little extra memory but reduce the method calls by ~68x.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: