banx
banx

Reputation: 4416

How to know what index is being used in SQL queries?

Having multiple indices for an SQL table, is there a way to know what index will be used automatically when using a specific query?

EDIT: I wanted the question to be general, but I mostly use MySQL, PostgreSQL and SQLite

Upvotes: 1

Views: 291

Answers (1)

Ned Batchelder
Ned Batchelder

Reputation: 375634

Use the EXPLAIN PLAN statement to see what the dbms will do with your query.

Upvotes: 1

Related Questions