use of org.neo4j.kernel.impl.coreapi.internal.RelationshipTypePropertyIterator in project neo4j by neo4j.
the class TransactionImpl method getRelationshipsByTypeAndPropertyWithoutPropertyIndex.
private ResourceIterator<Relationship> getRelationshipsByTypeAndPropertyWithoutPropertyIndex(KernelTransaction ktx, int typeId, PropertyIndexQuery... queries) {
var index = findUsableMatchingIndex(ktx, SchemaDescriptor.forAnyEntityTokens(EntityType.RELATIONSHIP));
if (index != IndexDescriptor.NO_INDEX) {
try {
var session = ktx.dataRead().tokenReadSession(index);
var cursor = ktx.cursors().allocateRelationshipTypeIndexCursor(ktx.cursorContext());
ktx.dataRead().relationshipTypeScan(session, cursor, unconstrained(), new TokenPredicate(typeId));
var relationshipScanCursor = ktx.cursors().allocateRelationshipScanCursor(ktx.cursorContext());
var propertyCursor = ktx.cursors().allocatePropertyCursor(ktx.cursorContext(), ktx.memoryTracker());
return new RelationshipTypePropertyIterator(ktx.dataRead(), cursor, relationshipScanCursor, propertyCursor, c -> newRelationshipEntity(c.relationshipReference()), coreApiResourceTracker, queries);
} catch (KernelException e) {
// ignore, fallback to all node scan
}
}
return getRelationshipsByTypeAndPropertyViaAllRelsScan(ktx, typeId, queries);
}
Aggregations