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

Better estimate join row count when one of the sides is known to be unique

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.21.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      For instance:
      1) select from emp e left join dept d on (e.X = d.id)
      This query can't multiply rows, so its row count estimation is rowCount(join.left)

      2) select from dept d right join emp e on (d.id = e.X)
      This query can't multiply rows, so its row count estimation is rowCount(join.right)

      3) select from emp e join dept d on (e.id = d.id)
      The rows can't be multiplied here as well

      Currently, Calcite estimates the number of rows as left*right which is an overestimation in many cases

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vladimirsitnikov Vladimir Sitnikov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: