@@ -3,17 +3,17 @@ SELECT ni.nspname || '.' || ct.relname AS "table",
33 pg_get_indexdef(i .indexrelid ) AS " dup index definition" ,
44 i .indkey AS " dup index attributes" ,
55 cii .relname AS " encompassing index" ,
6- pg_get_indexdef(ii .indexrelid ) AS " encompassing index definition"
7- ii .indkey AS " enc index attributes" ,
6+ pg_get_indexdef(ii .indexrelid ) AS " encompassing index definition" ,
7+ ii .indkey AS " enc index attributes"
88 FROM pg_index i
99 JOIN pg_class ct ON i .indrelid = ct .oid
1010 JOIN pg_class ci ON i .indexrelid = ci .oid
1111 JOIN pg_namespace ni ON ci .relnamespace = ni .oid
1212 JOIN pg_index ii ON ii .indrelid = i .indrelid AND
1313 ii .indexrelid != i .indexrelid AND
14- array_to_string(ii .indkey , ' ' ) like (array_to_string(i .indkey , ' ' ) || ' %' ) AND
15- array_to_string(ii .indcollation , ' ' ) like (array_to_string(i .indcollation , ' ' ) || ' %' ) AND
16- array_to_string(ii .indclass , ' ' ) like (array_to_string(i .indclass , ' ' ) || ' %' ) AND
14+ ( array_to_string(ii .indkey , ' ' ) || ' ' ) like (array_to_string(i .indkey , ' ' ) || ' %' ) AND
15+ ( array_to_string(ii .indcollation , ' ' ) || ' ' ) like (array_to_string(i .indcollation , ' ' ) || ' %' ) AND
16+ ( array_to_string(ii .indclass , ' ' ) || ' ' ) like (array_to_string(i .indclass , ' ' ) || ' %' ) AND
1717 NOT (ii .indkey ::integer [] @> ARRAY[0 ]) AND
1818 NOT (i .indkey ::integer [] @> ARRAY[0 ]) AND
1919 CASE WHEN i .indisunique THEN ii .indisunique ELSE true END
0 commit comments