Remove unused partitioned index index_p_ci_build_sources_on_pipeline_...

What does this MR do and why?

Remove the unused partitioned index public.index_p_ci_build_sources_on_pipeline_source on p_ci_build_sources with remove_concurrent_partitioned_index_by_name. All 16 child partition indexes reported zero scans over a 10-day pre-filter window on the patroni-ci Patroni cluster (query run at 2026-08-24T23:50:49Z). Verify the 180-day chart below as confirmation before merging.

Definition:

CREATE INDEX index_p_ci_build_sources_on_pipeline_source ON ONLY public.p_ci_build_sources USING btree (pipeline_source)

⚠️ Partitioned removal specifics

  • Dropping the parent index cascades to every partition in one operation and takes a brief ACCESS EXCLUSIVE lock under with_lock_retries. There is no asynchronous removal path for partitioned indexes.
  • On tables with rolling partitions, partitions older than the retention window have already been dropped, so the chart below only covers the currently attached partitions. Factor the retention period into your judgment of the 180-day evidence.

Required: verify the 180-day Grafana chart before merging

The Keep's 10-day window is a fast pre-filter, not a final verdict. Per Dropping unused indexes, confirm via Grafana over at least 6 months before merging.

Open this query in Grafana Explore (6-month range, mimir-gitlab-gprd). The chart should be flat at 0. The query sums scans across the child indexes attached at the time this MR was created:

  • ci_build_sources_103_pipeline_source_idx
  • ci_build_sources_104_pipeline_source_idx
  • ci_build_sources_105_pipeline_source_idx
  • ci_build_sources_106_pipeline_source_idx
  • ci_build_sources_107_pipeline_source_idx
  • ci_build_sources_108_pipeline_source_idx
  • ci_build_sources_109_pipeline_source_idx
  • ci_build_sources_110_pipeline_source_idx
  • ci_build_sources_111_pipeline_source_idx
  • ci_build_sources_112_pipeline_source_idx
  • ci_build_sources_113_pipeline_source_idx
  • ci_build_sources_114_pipeline_source_idx
  • ci_build_sources_115_pipeline_source_idx
  • index_24f9197b73
  • index_c0e71b0908
  • index_de35138259

Cross-environment review checklist

An index that is idle on GitLab.com may still be required elsewhere:

  • No GitLab Self-Managed or GitLab Dedicated feature relies on this index.
  • No low-frequency (quarterly, yearly) cron uses the column(s) this index covers.
  • Kibana (pubsub-postgres-inf-gprd*, last 7 days): review json.sql: p_ci_build_sources AND json.sql: *pipeline_source* and confirm no query filters/orders on pipeline_source in a way this index would serve. A text match alone is not index usage; PostgreSQL favours the index when a query filters on its leading column(s).

If this index must be kept

Add an entry to keeps/cleanup_unused_indexes/index_keep_list.yml and close this MR:

"public.index_p_ci_build_sources_on_pipeline_source":
  reason: "<why this index must stay>"
  added_by: "@<your-handle>"
  added_on: "2026-08-24"

The Keep will not propose this index again.

This change was generated by gitlab-housekeeper in CI using the Keeps::CleanupUnusedPartitionedIndexes keep.

To provide feedback on your experience with gitlab-housekeeper please create an issue with the label GitLab Housekeeper and consider pinging the author of this keep.

Edited by Tiger Watson

Merge request reports

Loading
Loading