Add full index on namespaces for type and id, asynchronously
As discussed here, add an index on namespaces
table targeting type
and id
.
There currently exists a partial index on these columns
CREATE INDEX "index_namespaces_on_type_and_id_partial" ON "public"."namespaces" USING btree (
"type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
"id" "pg_catalog"."int4_ops" ASC NULLS LAST
) WHERE type IS NOT NULL;
Since we're making all namespaces have a type, such as User
or Group
, we now need a full index rather than a partial. The partial will be removed in an upcoming MR.
Since namespaces
is a large and highly trafficked table, we use the procedure detailed here: Create indexes asynchronously
This is the asynchronous migration, to be followed by the synchronous migration in #342544 (closed)
Edited by Brett Walker