Hello,
I have been reading the documentation and the GSQL 101 tutorial and I was wondering how TigerGraph is dealing with queries such as :
SELECT * FROM person where age > 20
Is there any possible kind of indexing on the age property or are all person nodes scanned ?
If not, what is the best strategy to fasten this type of initial filtering, in particular for the case of parametrized queries.
For instance, using the GSQL 101 code, we could imagine the following use case :
USE GRAPH social CREATE QUERY hello2 (INT minAge) FOR GRAPH social{
OrAccum @visited = false;
AvgAccum @@avgAge;
Start ={person.* where age > minAge}; <-- this line is invalid but from the documentation I can't find a proper way to perform such sub-set definition
FirstNeighbors = SELECT tgt
FROM Start:s -(friendship:e)-> person:tgt
ACCUM tgt.@visited += true, s.@visited += true;
SecondNeighbors = SELECT tgt
FROM FirstNeighbors -(:e)-> :tgt
WHERE tgt.@visited == false
POST_ACCUM @@avgAge += tgt.age;
PRINT SecondNeighbors;
PRINT @@avgAge;
}