I’m having trouble with JanusGraph. It’s doing full table scans for equality queries instead of using the indexed backend for better performance. Here’s what’s going on:
Using JanusGraph server with AWS Keyspace and Elasticsearch
Elasticsearch is set up correctly and data is being stored as expected
For equality-based queries, JanusGraph does full scans instead of using indexes
It works fine with textContains queries, using the indices as it should
I tried running this query:
g.E().has("edge_id","abc123").profile()
The profile shows it’s doing a full scan, not using any index.
This profile shows it’s using the edge_information index.
Is there a setting I’m missing? Full table scans are really slow. It works fine with indexed queries when I run JanusGraph locally. Any ideas on how to fix this?
hm, sounds like a tricky issue. Have u checked ur index configuration in janusgraph-config? sometimes the index settings dont get applied right for equality queries. maybe try rebuilding the indices or double check the mapping in elasticsearch? also, what version of janusgraph r u using? older versions had some quirks w/ index usage
hey there JumpingBear, that’s an interesting problem! have u tried using the .explain() step instead of .profile()? it might give more insight into why JanusGraph is choosing full scans. also, curious - what’s ur edge_id property type? sometimes string properties need special handling. oh, and have u checked if theres any caching issues? lemme know if u find anything!
I’ve encountered similar issues with JanusGraph and AWS Keyspaces. One often overlooked aspect is the consistency level configuration. Ensure you’ve set the appropriate consistency level for your reads and writes in the JanusGraph configuration. Additionally, verify that your edge_id property is properly defined as a ‘Mixed Index’ in your schema. If these checks don’t resolve the issue, consider examining your data model. Sometimes, the way edges are structured can impact query performance. Lastly, run a reindex operation to ensure all your data is properly indexed. This can sometimes resolve unexpected full table scans.