SQL - EXPLAIN & Query Plans
Overview
EXPLAIN shows how the optimizer plans to execute your query. Use it to ensure index usage and spot scans.
EXPLAIN SELECT * FROM employees WHERE department_id = 1;
SET SHOWPLAN_TEXT ON;
GO
SELECT * FROM employees WHERE department_id = 1;
GO
SET SHOWPLAN_TEXT OFF;
EXPLAIN QUERY PLAN SELECT * FROM employees WHERE department_id = 1;