-
Notifications
You must be signed in to change notification settings - Fork 12
add indexes and constraints content #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add indexes and constraints content #36
Conversation
documentation/movies.workspace.adoc
Outdated
|
||
Note that you can also add constraints to your data to ensure uniqueness for example. | ||
Adding constraints automatically adds a correpsonding index. | ||
See link:https://neo4j.com/docs/cypher-manual/current/constraints/[Cypher Manual -> Constraints] for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to add a ^
to the hyperlink to open in a new window?
e.g.
https://neo4j.com/docs/cypher-manual/current/constraints/[Cypher Manual -> Constraints^]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right! I'll amend! Thanks!
@@ -35,9 +35,6 @@ image::movie-model.png[] | |||
|
|||
[source,cypher] | |||
---- | |||
CREATE CONSTRAINT movie_title IF NOT EXISTS FOR (m:Movie) REQUIRE m.title IS UNIQUE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't change it, it needs to stay here. other wise the performance will be affected as each MERGE needs to do a full label-scan to find the relevant nodes.
@@ -702,6 +699,22 @@ MATCH path = (person)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d) | |||
RETURN path; | |||
---- | |||
|
|||
To aid query performance, you can add indexes to your data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either move this to the beginning, but we should ensure that people execute this cypher-block, or keep it in the MERGE statement.
No description provided.