Created
September 11, 2018 01:42
-
-
Save cirode/9666edb6ef20d0bd1e891b4bcdc26b7a to your computer and use it in GitHub Desktop.
Disable indexes postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE pg_index | |
SET indisready=false | |
WHERE indrelid = ( | |
SELECT oid | |
FROM pg_class | |
WHERE relname='<TABLE_NAME>' | |
); | |
UPDATE pg_index | |
SET indisready=true | |
WHERE indrelid = ( | |
SELECT oid | |
FROM pg_class | |
WHERE relname='<TABLE_NAME>' | |
); | |
REINDEX <TABLE_NAME>; | |
-- https://fle.github.io/temporarily-disable-all-indexes-of-a-postgresql-table.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment