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

Function Schema_ActivateExactMatchIndex

src/schema/schema.c:232–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void Schema_ActivateExactMatchIndex
233(
234 Schema *s // schema to activate index on
235) {
236 Index active = ACTIVE_EXACTMATCH_IDX(s);
237 Index pending = PENDING_EXACTMATCH_IDX(s);
238
239 ASSERT(Index_Enabled(pending) == true);
240
241 // drop active if exists
242 if(active != NULL) {
243 Index_Free(active);
244 }
245
246 // set pending index as active
247 ACTIVE_EXACTMATCH_IDX(s) = pending;
248
249 // clear pending index
250 PENDING_EXACTMATCH_IDX(s) = NULL;
251
252 //--------------------------------------------------------------------------
253 // update unique constraint private data
254 //--------------------------------------------------------------------------
255
256 active = ACTIVE_EXACTMATCH_IDX(s);
257
258 // uniqie constraint rely on exact-match indicies
259 // whenever such an index is updated
260 // we need to update the relevant uniqie constraint
261 uint n = array_len(s->constraints);
262 for(uint i = 0; i < n; i++) {
263 Constraint c = s->constraints[i];
264 Constraint_SetPrivateData(c, active);
265 }
266}
267
268static void Schema_ActivateFullTextIdx
269(

Callers 1

Schema_ActivateIndexFunction · 0.85

Calls 4

Index_EnabledFunction · 0.85
Index_FreeFunction · 0.85
array_lenFunction · 0.85

Tested by

no test coverage detected