Remove unused index_oauth_access_grants_on_created_at_expires_in
What does this MR do and why?
Remove unused index_oauth_access_grants_on_created_at_expires_in
Remove the unused index_oauth_access_grants_on_created_at_expires_in index on oauth_access_grants that was previously added to support the cleanup worker but is no longer being used.
Related to: #562376
Metrics showing the unused index:
References
- Issue: #562376
- Related worker: !207837 (merged)
- https://docs.gitlab.com/development/database/adding_database_indexes/#dropping-unused-indexes
Database
Migration up
>>> Executing: bin/rails db:migrate:up:main VERSION=20251205113108
DEPRECATION WARNING: `config.active_record.warn_on_records_fetched_greater_than` is deprecated and will be removed in Rails 8.0. Please subscribe to `sql.active_record` notifications and access the row count field to detect large result set sizes. (called from <main> at /Users/daniele/projects/gdk/gitlab/config/environment.rb:7)
main: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 76111
main: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: migrating =
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0193s
main: -- indexes(:oauth_access_grants)
main: -> 0.0028s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- remove_index(:oauth_access_grants, {:algorithm=>:concurrently, :name=>"index_oauth_access_grants_on_created_at_expires_in"})
main: -> 0.0025s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: migrated (0.0946s)
main: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 76111
>>> Executing: bin/rails db:migrate:up:ci VERSION=20251205113108
DEPRECATION WARNING: `config.active_record.warn_on_records_fetched_greater_than` is deprecated and will be removed in Rails 8.0. Please subscribe to `sql.active_record` notifications and access the row count field to detect large result set sizes. (called from <main> at /Users/daniele/projects/gdk/gitlab/config/environment.rb:7)
ci: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 76195
ci: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: migrating =
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci: -> 0.0169s
ci: -- indexes(:oauth_access_grants)
ci: -> 0.0035s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0003s
ci: -- remove_index(:oauth_access_grants, {:algorithm=>:concurrently, :name=>"index_oauth_access_grants_on_created_at_expires_in"})
ci: -> 0.0018s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0003s
ci: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: migrated (0.0979s)
ci: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 76195
Migration down
>>> Executing: bin/rails db:migrate:down:main VERSION=20251205113108
DEPRECATION WARNING: `config.active_record.warn_on_records_fetched_greater_than` is deprecated and will be removed in Rails 8.0. Please subscribe to `sql.active_record` notifications and access the row count field to detect large result set sizes. (called from <main> at /Users/daniele/projects/gdk/gitlab/config/environment.rb:7)
main: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 75309
main: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: reverting =
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0202s
main: -- index_exists?(:oauth_access_grants, [:created_at, :expires_in], {:name=>"index_oauth_access_grants_on_created_at_expires_in", :algorithm=>:concurrently})
main: -> 0.0028s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0004s
main: -- add_index(:oauth_access_grants, [:created_at, :expires_in], {:name=>"index_oauth_access_grants_on_created_at_expires_in", :algorithm=>:concurrently})
main: -> 0.0038s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: reverted (0.0985s)
main: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 75309
>>> Executing: bin/rails db:migrate:down:ci VERSION=20251205113108
DEPRECATION WARNING: `config.active_record.warn_on_records_fetched_greater_than` is deprecated and will be removed in Rails 8.0. Please subscribe to `sql.active_record` notifications and access the row count field to detect large result set sizes. (called from <main> at /Users/daniele/projects/gdk/gitlab/config/environment.rb:7)
ci: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 75397
ci: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: reverting =
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci: -> 0.0178s
ci: -- index_exists?(:oauth_access_grants, [:created_at, :expires_in], {:name=>"index_oauth_access_grants_on_created_at_expires_in", :algorithm=>:concurrently})
ci: -> 0.0031s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0003s
ci: -- add_index(:oauth_access_grants, [:created_at, :expires_in], {:name=>"index_oauth_access_grants_on_created_at_expires_in", :algorithm=>:concurrently})
ci: -> 0.0021s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0003s
ci: == 20251205113108 RemoveIndexOauthAccessGrantsOnCreatedAtExpiresIn: reverted (0.0975s)
ci: == [advisory_lock_connection] object_id: 130900, pg_backend_pid: 75397
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Daniele Bracciani