Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-13-2021 09:10 PM
Would it be a good idea to return a whole node instead of node properties because of a lower db hits.
PROFILE
MATCH (s:Shape)-[:LOCATED]-(g)
RETURN g
LIMIT 10
13 total db hits
PROFILE
MATCH (s:Shape)-[:LOCATED]-(g)
RETURN g.code
LIMIT 10
23 total db hits
10-14-2021 09:39 AM
When you use PROFILE
, you should be aware that it is dependent on whether the query was compiled first as well as the version of the database. A more detailed explanation can be found in this discussion.
Also it is worth asking whether you have an index set up on your nodes? This is an important part of tuning your Cypher query and can greatly reduce DB hits. You can read more about that here and here. But, in general, it is always a good idea in general to return the value of a property rather than the full node/relationships in order to improve performance (more detail here).
All the sessions of the conference are now available online