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

RexSimplify#simplifyAnds foregoes some simplications if unknownAsFalse set to true

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      It looks like RexSimplify#simplifyAnds foregoes some comparison simplifications if unknownAsFalse is set to true, like A = A AND B = B which might be simplified to A IS NOT NULL AND B IS NOT NULL or even true if A and B are known to be not nullable.

      One consequence of this is that the selectivity value might be off as a = comparison has a selectivity of 15% whereas IS NOT NULL has a selectivity of 90%.

      The simplication is skipped because RexSimplify#simplifyList simplify all terms with unknownAsFalse set to false, but in RexSimplify#simplifyAnd2ForUnknownAsFalse, there's no attempt at trying again to simplify each term.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                laurent Laurent Goujon
                Reporter:
                laurent Laurent Goujon
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

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