ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bearrito <barr...@bnrobotics.com>
Subject Correlated Subquery Performance
Date Fri, 24 Jun 2016 12:56:53 GMT
First off I recognize this is probably more of an H2 issue than ignite but
I'm asking her in hopes someone has seen similar behavior

I have Partitioned cache on which I'm trying to run the following query.
Keys are collocated based on the internalRobotName 

My target query is: 
"SELECT S1.* FROM STATEFULROBOTTELEMETRY S1 where S1.internalRobotName = ?
and internalMissionId = (SELECT internalMissionId FROM
internalTimeStamp  DESC LIMIT 1   )

I have grouped index like (internalRobotName , internalTimeStamp,
internalMissionId )

The above query with a moderate amount of keys ~1M runs very slowly. 

Essentially I'm trying to find the latest grouping of entries for what my
teams calls a mission. I believe that the subquery should use the index to
push the limit down and return only the latest missionId.

If instead I first query for the latest mission, essentially pulling the
subquery out into a intermediate cache query, then pass that as an arg via
query.setArgs(...)  to a final query, then that runs quite bit faster and
meets performance criteria.

Any thoughts on this?



View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Correlated-Subquery-Performance-tp5877.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message