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

Function GraphContext_GetIndexByID

src/graph/graphcontext.c:577–598  ·  view source on GitHub ↗

attempt to retrieve an index on the given label and attribute IDs

Source from the content-addressed store, hash-verified

575
576// attempt to retrieve an index on the given label and attribute IDs
577Index GraphContext_GetIndexByID
578(
579 const GraphContext *gc, // graph context
580 int lbl_id, // label / rel-type ID
581 const Attribute_ID *attrs, // attributes
582 uint n, // attributes count
583 IndexType idx_type, // index type
584 GraphEntityType entity_type // schema type NODE / EDGE
585) {
586 // validations
587 ASSERT(gc != NULL);
588 ASSERT((attrs == NULL && n == 0) || (attrs != NULL && n > 0));
589
590 // retrieve the schema for given id
591 SchemaType st = (entity_type == GETYPE_NODE) ? SCHEMA_NODE : SCHEMA_EDGE;
592 Schema *s = GraphContext_GetSchemaByID(gc, lbl_id, st);
593 if(s == NULL) {
594 return NULL;
595 }
596
597 return Schema_GetIndex(s, attrs, n, idx_type, false);
598}
599
600// attempt to retrieve an index on the given label and attribute
601Index GraphContext_GetIndex

Callers 1

reduce_scan_opFunction · 0.85

Calls 2

Schema_GetIndexFunction · 0.85

Tested by

no test coverage detected