May 17, 2026, 11:40 PM
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
SELECT 'DROP INDEX IF EXISTS "' || n.nspname || '"' || '.' || '"' || i.indexrelname || '"' ||';'
|
||||
FROM pg_stat_all_indexes i
|
||||
JOIN pg_class c ON (c.oid = i.relid)
|
||||
JOIN pg_namespace n ON (n.oid = c.relnamespace)
|
||||
JOIN pg_index idx ON (idx.indexrelid = i.indexrelid )
|
||||
WHERE NOT idx.indisprimary
|
||||
AND i.relname NOT LIKE 'pg_%'
|
||||
ORDER BY i.indexrelname;
|
||||
Reference in New Issue
Block a user