Commit 291ff03f authored by Andreas Brandl's avatar Andreas Brandl

Simplify postgres_indexes view

parent 10653fab
......@@ -24,8 +24,7 @@ class AddIndexTypeToPostgresIndexesView < ActiveRecord::Migration[6.1]
JOIN pg_class i ON i.oid = pg_index.indexrelid
JOIN pg_namespace ON i.relnamespace = pg_namespace.oid
JOIN pg_indexes ON i.relname = pg_indexes.indexname
LEFT JOIN pg_class t ON t.oid = pg_index.indrelid
LEFT JOIN pg_am a ON i.relam = a.oid
JOIN pg_am a ON i.relam = a.oid
WHERE pg_namespace.nspname <> 'pg_catalog'::name AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name]));
SQL
end
......
......@@ -16597,12 +16597,11 @@ CREATE VIEW postgres_indexes AS
(pg_index.indpred IS NOT NULL) AS partial,
pg_indexes.indexdef AS definition,
pg_relation_size((i.oid)::regclass) AS ondisk_size_bytes
FROM (((((pg_index
FROM ((((pg_index
JOIN pg_class i ON ((i.oid = pg_index.indexrelid)))
JOIN pg_namespace ON ((i.relnamespace = pg_namespace.oid)))
JOIN pg_indexes ON ((i.relname = pg_indexes.indexname)))
LEFT JOIN pg_class t ON ((t.oid = pg_index.indrelid)))
LEFT JOIN pg_am a ON ((i.relam = a.oid)))
JOIN pg_am a ON ((i.relam = a.oid)))
WHERE ((pg_namespace.nspname <> 'pg_catalog'::name) AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name])));
CREATE VIEW postgres_partitioned_tables AS
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment