Skip to content

Duplicate index doesn't check Foreign Keys #478

@drupaladmin

Description

@drupaladmin

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions