You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Glenn Justo Galvizo (Jira)" <ji...@apache.org> on 2021/06/29 00:48:00 UTC

[jira] [Created] (ASTERIXDB-2921) INLJ w/ Quantification

Glenn Justo Galvizo created ASTERIXDB-2921:
----------------------------------------------

             Summary: INLJ w/ Quantification
                 Key: ASTERIXDB-2921
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2921
             Project: Apache AsterixDB
          Issue Type: New Feature
          Components: IDX - Indexes
            Reporter: Glenn Justo Galvizo
            Assignee: Glenn Justo Galvizo


The following query should be optimized, but currently isn't:
{code:java}
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(*);
{code}
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. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)