Glenn Justo Galvizo created ASTERIXDB-2964:
----------------------------------------------

             Summary: UNNEST style join query with composite atomic-array index 
not recognized
                 Key: ASTERIXDB-2964
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2964
             Project: Apache AsterixDB
          Issue Type: Bug
          Components: IDX - Indexes
            Reporter: Glenn Justo Galvizo
            Assignee: Glenn Justo Galvizo


*Found with RQG.

UNNEST style join queries to use composite atomic-array indexes are not being 
accelerated. Queries can be rewritten to use a quantified expression style join 
to utilize the index. Example of query that is not accelerated is given below:

 
{code:java}
SET `compiler.arrayindex` "true";
DROP DATAVERSE TestDataverse1 IF EXISTS;
CREATE DATAVERSE TestDataverse1;
USE TestDataverse1;
CREATE TYPE TestType AS {
 _id: uuid
};
CREATE DATASET Dataset1 (TestType)
PRIMARY KEY _id AUTOGENERATED;
CREATE DATASET Dataset2 (TestType)
PRIMARY KEY _id AUTOGENERATED;
CREATE INDEX d1Idx
ON Dataset1 (
 field1 : bigint,
 ( UNNEST outer_items
 UNNEST inner_items
 SELECT field2 : bigint,
 field3 : bigint ),
 field4 : bigint
);
FROM Dataset2 D2,
 Dataset1 D1
 UNNEST D1.outer_items DOI
 UNNEST DOI.inner_items DII
WHERE D1.field1 /* +indexnl */ = TO_BIGINT(D2.field1) AND 
 DII.field2 /* +indexnl */ = TO_BIGINT(D2.field2) AND 
 DII.field3 /* +indexnl */ = TO_BIGINT(D2.field3) AND 
 D1.field4 /* +indexnl */ = TO_BIGINT(D2.field4)
SELECT *;
{code}
 



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

Reply via email to