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

Store constants as a derived field in RelOptPredicateList

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.11.0
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: