Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
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.