This is my graph:
GSQL > ls
---- Graph nba
Vertex Types:
- VERTEX player(PRIMARY_ID name STRING, name STRING, age INT, gender STRING, state STRING) WITH STATS="OUTDEGREE_BY_EDGETYPE", TAGGABLE="true"
Edge Types:
Indexes:
- player_name_index:player(name)
Graphs:
- Graph nba(player:v)
Tag Graphs:
- Graph tagged_nba(player:v)
Tag Expressions:
- Vertex player: mvp&shooter
Jobs:
- CREATE SCHEMA_CHANGE JOB add_tags {
ADD TAG mvp DESCRIPTION "most valuable player";
ADD TAG shooter DESCRIPTION "shooter";
}
Queries:
- addTagsToPlayer(vertex<player> p) (installed v2)
- get(vertex<player> p) (installed v2)
- getWithIndex(string k) (installed v2)
- getWithTag(string tag, string k) (installed v2)
Tags:
- TAG mvp DESCRIPTION "most valuable player"
- TAG shooter DESCRIPTION "shooter"
This is my query(getWithIndex):
CREATE QUERY getWithIndex(STRING k) {
res =
SELECT v
FROM player:v
WHERE v.name > k;
PRINT res;
}
I expect this query to hit the attribute index(player_name_index), but I’m not sure if it did. Is there any way to get this information?
GSQL > run query getWithIndex("Tim")
{
"error": false,
"message": "",
"version": {
"schema": 2,
"edition": "enterprise",
"api": "v2"
},
"results": [{"res": [{
"v_id": "Tim Duncan",
"attributes": {
"gender": "male",
"name": "Tim Duncan",
"state": "ca",
"age": 40
},
"v_type": "player"
}]}]
}