I am trying to understand understand how gremlin queries work, especially when it comes to "AND" like queries.
When I execute the following query, it produces results in approximately 17 seconds.
g.V().has(id, gte(51200)).has(id, lte(51200000)).count().profile()
However, if I append another has statement to this such as the following, it doesn't even finish evaluating in 5 minutes.
g.V().has(id, gte(51200)).has(id, lte(51200000)).has('entity_type', 'Human').count().profile()
My expectation was that the added "has" step would only be executed on traversals that pass through the first two has steps. Therefore, I didn't expect this last has statement to add much time to the overall query, since it would simply be checking the value of a property.
My back end is a JanusGraph, configured with ElasticSearch and Google BigTable. It's got about 5 million vertices loaded.
Any guidance on this would be highly appreciated.