MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / IndexScanInit

Function IndexScanInit

src/execution_plan/ops/op_node_by_index_scan.c:50–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50static OpResult IndexScanInit(OpBase *opBase) {
51 IndexScan *op = (IndexScan *)opBase;
52
53 if(opBase->childCount > 0) {
54 // find out how many different entities are refered to
55 // within the filter tree, if number of entities equals 1
56 // (current node being scanned) there's no need to re-build the index
57 // query for every input record
58 rax *entities = FilterTree_CollectModified(op->filter);
59 op->rebuild_index_query = raxSize(entities) > 1; // this is us
60 raxFree(entities);
61
62 OpBase_UpdateConsume(opBase, IndexScanConsumeFromChild);
63 }
64
65 // resolve label ID now if it is still unknown
66 if(op->n->label_id == GRAPH_UNKNOWN_LABEL) {
67 GraphContext *gc = QueryCtx_GetGraphCtx();
68 Schema *schema = GraphContext_GetSchema(gc, op->n->label, SCHEMA_NODE);
69 ASSERT(schema != NULL);
70 op->n->label_id = schema->id;
71 }
72
73 return OP_OK;
74}
75
76static inline void _UpdateRecord(IndexScan *op, Record r, EntityID node_id) {
77 // Populate the Record with the graph entity data.

Callers

nothing calls this directly

Calls 4

OpBase_UpdateConsumeFunction · 0.85
QueryCtx_GetGraphCtxFunction · 0.85
GraphContext_GetSchemaFunction · 0.85

Tested by

no test coverage detected