| 48 | } |
| 49 | |
| 50 | static 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 | |
| 76 | static inline void _UpdateRecord(IndexScan *op, Record r, EntityID node_id) { |
| 77 | // Populate the Record with the graph entity data. |
nothing calls this directly
no test coverage detected