databasessqlsystem-design
Do composite indexes reward the right column order?
Anonymous
for an index on (team_id, created_at), a query that filters by team_id and then ranges over created_at can often use the ordered prefix efficiently. A query on created_at alone may benefit less, because entries are grouped by team_id first. The exact plan depends on the database and data distribution; inspect the plan, and account for the extra write and storage cost of each index.
0