Steven Jacobs has posted comments on this change.

Change subject: ASTERIXDB-1608, ASTERIXDB-1617 Match user query for nonpure 
function calls
......................................................................


Patch Set 7:

I tried to make the "don't move nonpures" requirement a little more robust in 
this patch set. In addition, I looked at both of Yingyi's queries:

QUERY1:
for $x in dataset Users1
let $time := current-time()
for $y in dataset Users2
where $y.stamp > $time-time("123045678+0800")
return {
   "x_id": $x.id,
   "y_id": $y.id
} 

This query doesn't pick up the index currently. I think it would be possible to 
do, but I never looked at optimizing the join case. It seems like an edge case 
where the join would actually want to use a field that wasn't from either 
datasource. If this query were really desirable, it could be written in a way 
that makes sense logically and does use the index with my change, e.g.

BETTER QUERY1:
let $time := current-time()-time("123045678+0800")
for $y in dataset Users2
where $y.stamp > $time
for $x in dataset Users1
return {
   "x_id": $x.id,
   "y_id": $y.id
}


QUERY2:
for $x in dataset foo
let $time := current-time()
return {
   "x_id": $x.id,
   "y_ids": for $y in dataset bar where $y.time > $time-50
} 

This second query picks up the index successfully. This is a subquery rather 
than a join so there is no issue converting to the index search.

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1057
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2dec322b30835625430c06acd7626d902bada137
Gerrit-PatchSet: 7
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-Reviewer: Preston Carman <[email protected]>
Gerrit-Reviewer: Steven Jacobs <[email protected]>
Gerrit-Reviewer: Yingyi Bu <[email protected]>
Gerrit-HasComments: No

Reply via email to