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

In LatticeSuggester, recommend lattices based on UNION queries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      In LatticeSuggester, recommend lattices based on UNION, EXCEPT and INTERSECT queries. Currently such queries are ignored.

      Given the query

      select * from t1 join t2
      union
      select * from t2 join t3;

      suggester should generate the same lattice(s) as if it had been given two separate queries

      select * from t1 join t2;
      select * from t2 join t3; 

      Which may be a single lattice t1 - t2 - t3, or might be two lattices t1 - t2, t2 - t3.

      Same for EXCEPT (MINUS), INTERSECT, UNION ALL, etc.

      If the set-op is internal, I'm not sure what to do, e.g.

      select *
      from sales
      join (select * from good_product
            union
            select * from bad_product) using (product_id)

       

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: