Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

francis.ofougwuka_151231 avatar image
francis.ofougwuka_151231 asked ·

Graph Query Traversal Plan with Cost

Is there a way to get graph query traversal plan and the cost assign to each steps without executing the steps?

gremlingraph-traversalquery-cost-plan
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

@francis.ofougwuka_151231 you can get metrics on a traversal by adding the profile() step. For example:

gremlin> g.V().has('recipe', 'name', 'Beef Bourguignon').inE().values('comment').profile()

For more info, see Anatomy of a graph traversal. Cheers!

3 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

@francis.ofougwuka_151231 if I understood your comment, it isn't possible to find out the cost of a query before it runs because Cassandra does not do a read-ahead. Cheers!

0 Likes 0 · ·

@Erick Ramirez I am aware of the .profile() command. But the problem with it is that it executes the query before providing the cost which is a bit slower.

For example, if i constructed a long running query that's bad in terms of performance, I will have to wait awhile to get the cost of my query.

0 Likes 0 · ·

@Erick Ramirez Thanks for the update.

1 Like 1 · ·