-
Notifications
You must be signed in to change notification settings - Fork 30
Description
ran into something regarding index optimization that I wanted to clarify — not sure if it’s a tool glitch or if I’m missing something.
Table : t_cln_account_performance
Optimizer Recommendation:
Duplicated index found account_master__account_id__account_performance in table t_cln_account_performance ([account_id]) is duplicated by idx_perf_acc_date_metric_upd_ts ([account_id, data_date, metric, upd_ts])
Suggested Query : DROP INDEX
It’s flagging that the foreign key–backing index on account_id is redundant because there’s already a composite index starting with the same column (account_id, data_date, metric, upd_ts).
While that’s technically correct — since composite indexes can serve leftmost prefix lookups — dropping this index directly would require removing the foreign key constraint, which would break referential integrity.
Could you help confirm if this is just an overzealous recommendation from the optimizer, or if there’s a safer way to handle it with fair performance overhead savings ?