A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.gitlab.com/development/database/maintenance_operations/ below:

Maintenance operations | GitLab Docs

Help us learn about your current experience with the documentation.

Take the survey

.

Maintenance operations

This page details various database related operations that may relate to development.

Disabling an index is not safe

Previously, this section described a procedure to mark the index as invalid before removing it. It’s no longer recommended, as it is not safe.

There are certain situations in which you might want to disable an index before removing it:

In such situations, the index was disabled in a coordinated manner with the infrastructure team and the database team by opening a production infrastructure issue with the “Production Change” template and then running the following commands:

-- Disable the index then run an EXPLAIN command known to use the index:
UPDATE pg_index SET indisvalid = false WHERE indexrelid = 'index_issues_on_foo'::regclass;
-- Verify the index is invalid on replicas:
SELECT indisvalid FROM pg_index WHERE indexrelid = 'index_issues_on_foo'::regclass;

-- Rollback the invalidation:
UPDATE pg_index SET indisvalid = true WHERE indexrelid = 'index_issues_on_foo'::regclass;

See this example infrastructure issue for reference.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4