pg_stat_user_indexes テーブルでわかるように、外部キー インデックスは使用されません。それらを削除したい。未使用のために外部キー インデックスを削除するデメリットはありますか。
db=# SELECT * FROM pg_stat_user_indexes WHERE relname='order_cancellationreason';
relid | indexrelid | schemaname | relname | indexrelname | idx_scan | idx_tup_read | idx_tup_fetch
-------+------------+------------+--------------------------+---------------------------------------------+----------+--------------+---------------
29835 | 31055 | public | order_cancellationreason | order_cancellationreason_address_id | 0 | 0 | 0
29835 | 31053 | public | order_cancellationreason | order_cancellationreason_cancelled_by_id | 0 | 0 | 0
db=#\d+ order_cancellationreason
...
Indexes:
"order_cancellationreason_cancelled_by_id" btree (cancelled_by_id)
"order_cancellationreason_address_id" btree (address_id)
Foreign-key constraints:
"cargo_id_refs_id_f4ffe34d" FOREIGN KEY (cargo_id) REFERENCES cargo_cargoinfo(id) DEFERRABLE INITIALLY DEFERRED
"order_cancellationreason_address_id_fkey" FOREIGN KEY (address_id) REFERENCES invoice_address(id) DEFERRABLE INITIALLY DEFERRED
"order_cancellationreason_cancelled_by_id_fkey" FOREIGN KEY (cancelled_by_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED