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/09/14 17:29:00 UTC

[jira] [Created] (ASTERIXDB-2962) Query w/ extra UNNESTs does not use array index

Glenn Justo Galvizo created ASTERIXDB-2962:
----------------------------------------------

             Summary: Query w/ extra UNNESTs does not use array index
                 Key: ASTERIXDB-2962
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2962
             Project: Apache AsterixDB
          Issue Type: Improvement
          Components: IDX - Indexes
            Reporter: Glenn Justo Galvizo


*Found from the RQG.

The following query does not utilize the index, even though it should. This is due to the presence of a redundant UNNEST operator (explicit UNNEST + quantified expression) on the indexed field.
{code:java}
USE TestDataverse;
DROP DATASET IndexedDataset IF EXISTS;
CREATE DATASET IndexedDataset (TestType)
PRIMARY KEY _id AUTOGENERATED;

CREATE INDEX testIndex ON IndexedDataset ( integer_rand_4.contained_object_2: BIGINT, ( UNNEST string_rand_26_c.contained_object_2 : STRING ), container_object_1.double_rand_20: DOUBLE );

SET `compiler.arrayindex` "true";
FROM IndexedDataset AS D1
UNNEST D1.string_rand_26_c.contained_object_2 AS G1
WHERE ( D1.integer_rand_4.contained_object_2 BETWEEN 0 AND 3 ) AND 
      ( D1.container_object_1.double_rand_20 <= 19 ) AND 
      ( SOME V1 IN D1.string_rand_26_c.contained_object_2 SATISFIES 
         ( V1 BETWEEN "A" AND "Z" ) )
SELECT D1._id AS PK1
ORDER BY D1._id
LIMIT 100;{code}



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