Michail Michailidis
Michail Michailidis

Reputation: 12191

Why I can't query a subset of data from Datastax DSE 5.0.x Graph without getting allow_scan is disabled error?

Hi I have disabled scans in my schema.

I know that queries like those wouldn't be allowed:

g.V()

g.V().hasLabel("User")

org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Could not find an index to answer query clause and graph.allow_scan is disabled:

I wonder why even those:

g.V().limit(2)

g.V().hasLabel("User").limit(2)

cause the same exception to be thrown! This is frustrating since they are bounded queries and they certainly don't cause full cassandra table scans..

Thanks

Upvotes: 0

Views: 100

Answers (1)

Daniel Kuppitz
Daniel Kuppitz

Reputation: 10904

There's an ongoing discussion about what kind of queries (if any at all) should be allowed with scans disabled. For now the rule is simple: If the initial step is not an index lookup, then it's considered to be a full scan.

It's easy to say that:

g.V().hasLabel("user").limit(2)

...for example should be allowed, but if that is not considered to be a full scan, then what about these:

g.V().hasLabel("user").limit(10)
g.V().hasLabel("user").limit(100)
g.V().hasLabel("user").limit(1000)
g.V().hasLabel("user").limit(10000)
g.V().hasLabel("user").limit(100000)

Where do we draw the line? I'm not expecting you to answer this question, just want to show that it's not as easy as it may seem at first.

Upvotes: 2

Related Questions