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

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.21.0
    • None
    • core
    • 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

            Unassigned Unassigned
            vladimirsitnikov Vladimir Sitnikov
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: