Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-3462

Incorrect cardinality estimation with multicolumn PK-PK self joins

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • COMP - Compiler

    Description

      Consider the orders collection in CH2 which has (o_id, o_w_id, and o_d_id) as the composite PK. The following query,

      select count(*) from orders x, orders y
       where x.o_id = y.o_id AND y.o_w_id = x.o_w_id AND y.o_d_id = x.o_d_id
      

      The overall cardinality of this should be the cardinality of orders since the join is a PK-PK join. However, we underestimate this cardinality as we do not recognize the composite PK.

      Attachments

        Activity

          People

            vsarathy1 Vijay Sarathy
            vsarathy1 Vijay Sarathy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: