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

INLJ w/ Quantification

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • IDX - Indexes
    • None

    Description

      The following query should be optimized, but currently isn't:

      SET `compiler.arrayindex` "true";
      
      DROP DATAVERSE TestYelp IF EXISTS;
      CREATE DATAVERSE TestYelp;
      USE TestYelp;
      
      CREATE TYPE CheckinType AS {
          checkin_id: uuid,
          business_id: string,
          dates: [string]
          };
      CREATE TYPE CheckinDatesToMarkersType AS {
          marker: string,
          datetime: string,
          date: string,
          time: string
          };
      
      CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY checkin_id AUTOGENERATED;
      CREATE DATASET YelpCheckinDateMarkers (CheckinDatesToMarkersType) PRIMARY KEY marker;
      CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST dates);
      
      FROM    YelpCheckinDateMarkers M, YelpCheckin C
      WHERE   M.datetime /*+ indexnl */ IN C.dates AND 
              C.business_id = "--Ni3oJ4VOqfOEu7Sj2Vzg"
      SELECT  COUNT(*);
      

      Grammar support needs to be added to recognize the INLJ hint in quantified expressions, and the same "throwaway branch" optimization from the SELECT-AM rule needs to be performed for the JOIN-AM rule. 

      Attachments

        Activity

          People

            ggalvizo Glenn Justo Galvizo
            ggalvizo Glenn Justo Galvizo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: