简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM