Browse Source

check only valid indexes

calling bt_metap during loading tuples in tree will corrupt this index: https://www.postgresql.org/message-id/flat/17568-ef121b956ec1559c%40postgresql.org
pull/12/head
melkij 3 years ago
parent
commit
38f6eced67
  1. 1
      sql/index_candidates_to_deduplicate.sql

1
sql/index_candidates_to_deduplicate.sql

@ -25,6 +25,7 @@ WHERE @@ -25,6 +25,7 @@ WHERE
c.relkind IN ('r', 'm') AND i.relkind = 'i'--skip partitioned indexes
AND (c.relpersistence = 'p' or not pg_is_in_recovery())--skip unlogged indexes
AND x.indisunique = 'f'--skip unique indexes
AND x.indisvalid = 't'
AND pg_relation_size(x.indexrelid) > 1024*1024--skip indexes smaller than 1MB
AND n.nspname != 'pg_catalog'
)

Loading…
Cancel
Save