Skip to content

Commit

Permalink
Merge pull request #9521 from systay/3.2-unique-index-read-birk
Browse files Browse the repository at this point in the history
Make sure to not use locking index seeks with read-only queries
  • Loading branch information
pontusmelke committed Jun 15, 2017
2 parents 0d71704 + 679d5ed commit 649cea5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.cypher.internal.helpers

import org.neo4j.cypher.javacompat.internal.GraphDatabaseCypherService
import org.neo4j.graphdb.schema.ConstraintDefinition

trait ConstraintCreator extends GraphIcing {
def createConstraint(graph: GraphDatabaseCypherService, label: String, property: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ object LogicalPlanConverter {
private def nodeUniqueIndexSeekAsCodeGen(indexSeek: NodeUniqueIndexSeek) = {
def indexSeekFun(opName: String, descriptorVar: String, expression: CodeGenExpression,
nodeVar: Variable, actions: Instruction) =
IndexUniqueSeek(opName, indexSeek.label.name, indexSeek.propertyKeys.map(_.name),
descriptorVar, expression, nodeVar, actions)
WhileLoop(nodeVar, IndexSeek(opName, indexSeek.label.name, indexSeek.propertyKeys.map(_.name),
descriptorVar, expression), actions)

sharedIndexSeekAsCodeGenPlan(indexSeekFun)(indexSeek.idName.name, indexSeek.valueExpr, indexSeek)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ class GeneratedMethodStructure(val fields: Fields, val generator: CodeBlock, aux
val schema = invoke(descriptor, method[IndexDescriptor, LabelSchemaDescriptor]("schema"))
val propertyKeyId = invoke(schema, method[LabelSchemaDescriptor, Int]("getPropertyId"))
body.assign(predicate, invoke(indexQueryExact, propertyKeyId, boxedValue))
body.assign(local, invoke(readOperations, nodeGetUniqueFromIndexLookup, descriptor,
body.assign(local, invoke(readOperations, indexQuery, descriptor,
newArray(typeRef[IndexQuery.ExactPredicate], predicate)))
}
}
Expand Down

0 comments on commit 649cea5

Please sign in to comment.