Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-25-2019 12:33 PM
I have a snippet of code where I run a query so I can extract the DbHits
for the query. My aim is to use this as a reference as I tune the queries. I am having an issue where I cannot seem to extract the "nested" DbHit values. Is there a key to accessing this?
Here is a sample of the code I am running:
public void Option1()
{
using (var session = _driver.Session())
{
var query = session.ReadTransaction(tx =>
{
var result = tx.Run("PROFILE MATCH (p:Process)-[:FIRST_STEP]->(ps_start:ProcessStep) " +
"MATCH path = (ps_start)-[:NEXT_STEP*]->() " +
"WITH nodes(path) AS steps " +
"UNWIND steps AS step " +
"RETURN step");
return result.Summary.Profile.DbHits;
//return result.Summary.Profile;
});
Console.WriteLine("Option 1: # of db hits = ");
//Console.WriteLine("Query Profile: ");
Console.WriteLine(query);
}
}
05-16-2019 11:12 AM
Try moving Console.WriteLine in place of the return. The return is probably what's screwing you up.
Console.WriteLine($"Option 1: # dbHits = {result.Summary.Profile.DbHits}");
Welcome to the land of C#
All the sessions of the conference are now available online