use of org.neo4j.kernel.impl.coreapi.internal.NodeLabelPropertyIterator in project neo4j by neo4j.
the class TransactionImpl method getNodesByLabelAndPropertyWithoutPropertyIndex.
private ResourceIterator<Node> getNodesByLabelAndPropertyWithoutPropertyIndex(KernelTransaction ktx, int labelId, PropertyIndexQuery... queries) {
var index = findUsableMatchingIndex(ktx, SchemaDescriptor.forAnyEntityTokens(EntityType.NODE));
if (index != IndexDescriptor.NO_INDEX) {
try {
var session = ktx.dataRead().tokenReadSession(index);
var cursor = ktx.cursors().allocateNodeLabelIndexCursor(ktx.cursorContext());
ktx.dataRead().nodeLabelScan(session, cursor, unconstrained(), new TokenPredicate(labelId));
var nodeCursor = ktx.cursors().allocateNodeCursor(ktx.cursorContext());
var propertyCursor = ktx.cursors().allocatePropertyCursor(ktx.cursorContext(), ktx.memoryTracker());
return new NodeLabelPropertyIterator(ktx.dataRead(), cursor, nodeCursor, propertyCursor, c -> newNodeEntity(c.nodeReference()), coreApiResourceTracker, queries);
} catch (KernelException e) {
// ignore, fallback to all node scan
}
}
return getNodesByLabelAndPropertyViaAllNodesScan(ktx, labelId, queries);
}
Aggregations