RedisGraph / redisgraph-bulk-loader

A Python utility for building RedisGraph databases from CSV inputs
http://redisgraph.io
BSD 3-Clause "New" or "Revised" License
67 stars 32 forks source link

How to select an index #103

Closed zhangliang-zl closed 1 year ago

zhangliang-zl commented 1 year ago

I want to use Device.id as the index. Now the query plan uses priority filtering software. How can I modify the statement to use Device.id as the index.

Is there a way to enforce the use of indexes?

Description of index selection priority?


create index on :Device(id)

GRAPH.EXPLAIN "graphDb" "MATCH (soft:Software)-[:installedOnDevice]-(dev:Device) WHERE dev.id = 'dev_id_1001'   and soft.invalid=0  and soft.node='node_id_1001' RETURN count(soft) "

1) "Results"
2) "    Aggregate"
3) "        Filter"
4) "            Conditional Traverse | (soft)->(dev:Device)"
5) "                Filter"
6) "                    Node By Index Scan | (soft:Software)"