Match index order to query patterns
Many database engines use the leftmost columns of a composite index most effectively. An index on (account_id, created_at) may support filtering by account and ordering dates within it, while a query on created_at alone may not benefit equally.
Review real query plans and representative data. Selectivity, joins, sort order, predicates, and engine behavior all affect whether the index is chosen and reduces work.
Measure impact and maintain deliberately
Compare execution time, rows scanned, and write overhead before and after adding the index. Building one on a large live table can consume resources or acquire locks; check the engine's online or concurrent options.
Remove redundant indexes only after confirming no important query depends on them. Recheck index usage as data volume and workload change; a once-useful index may become expensive without sufficient benefit.