Skip to content
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

Stop taking locks when reading from unique indexes #5988

Closed
wants to merge 4 commits into from

Conversation

systay
Copy link
Contributor

@systay systay commented Nov 30, 2015

No description provided.

@systay
Copy link
Contributor Author

systay commented Nov 30, 2015

When merging this into 3.0, we should use this:
https://github.com/pontusmelke/neo4j/commit/33d399c19a8d80d5f80a6564422b3ea2e3195b92

It makes sure the cost planner doesn't take locks when doing read-only access.

val result = executeWithAllPlanners("MATCH (n:Crew) WHERE n.name = 'Neo' RETURN n")

// Then
result.executionPlanDescription().toString should include("NodeUniqueIndexSeek")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use result should use("NodeUniqueIndexSeek")

(likewise for all tests in this class)

Probably not in 2.2

Tests that no locking happens when using index search in read-only queries
(using a new monitor).

def exactUniqueIndexSearch(index: IndexDescriptor, value: Any): Option[Node] = {
def lockingIndexSearch(index: IndexDescriptor, value: Any): Option[Node] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming of these methods is a bit inconsistent. Maybe call this one lockingExactIndexSearch?
Or maybe we can name them exactIndexSearchForRead and exactIndexSearchForWrite.

@systay
Copy link
Contributor Author

systay commented Dec 4, 2015

merged manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants