Skip to content

Drop an unused index on the namespaces table

What does this MR do and why?

Drops the index index_btree_namespaces_traversal_ids on namespaces, which is not used. Reducing the number of indexes on this table is important, as it should help with mitigating the risk of LWLock saturation incidents.

We can see this index has (almost) zero scans - https://thanos-query.ops.gitlab.net/graph?g0.expr=sum%20by%20(type)(rate(pg_stat_user_indexes_idx_scan%7Benv%3D%22gprd%22%2C%20type%3D%22patroni%22%2C%20indexrelname%3D%22index_btree_namespaces_traversal_ids%22%7D%5B30d%5D))&g0.tab=1&g0.stacked=0&g0.range_input=1h&g0.max_source_resolution=0s&g0.deduplicate=1&g0.partial_response=0&g0.store_matches=%5B%5D.

See #425973 (closed) for more details.

Rollback

In case we need to recreate this index manually, here i sth ecommand to do it:

create index concurrently index_btree_namespaces_traversal_ids on namespaces using btree (traversal_ids)

It should take less than 8 minutes on production - https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/22809/commands/73596.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #425973 (closed)

Edited by Krasimir Angelov

Merge request reports

Loading