Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-15771

CBO chooses wrong join order for TPC-DS query72

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 2.2.0
    • None
    • CBO
    • None

    Description

      Query72 of TPC-DS on 1TB scale generates wrong join order resulting in increased query execution time. It chooses fact-to-fact table join followed by joins with dimension tables as opposed to doing map-join with dimension tables first and doing the fact-to-fact table join at the last.

      Please find attachment for the join order selected by CBO vs rewritten query with expected join order.

      Attachments

        1. query72-mod.sql
          2 kB
          Prasanth Jayachandran
        2. query72.sql
          2 kB
          Prasanth Jayachandran
        3. q72-mod-explain.txt
          28 kB
          Prasanth Jayachandran
        4. q72-mod.svg
          222 kB
          Prasanth Jayachandran
        5. q72-explain.txt
          28 kB
          Prasanth Jayachandran
        6. q72.svg
          216 kB
          Prasanth Jayachandran

        Activity

          People

            Unassigned Unassigned
            prasanth_j Prasanth Jayachandran
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: