MySQL EXPLAIN FORMAT=JSON
MySQL EXPLAIN FORMAT=JSON is a SQL statement in the MySQL Specific category. MySQL: JSON-formatted EXPLAIN output with detailed cost information, index usage, and query execution plan. The syntax is EXPLAIN FORMAT=JSON SELECT ...;. It returns jSON execution plan. A typical example: EXPLAIN FORMAT=JSON SELECT e.name, d.dept_name FROM employees e JOIN departments d ON e.dept_id = d.id WHERE e.salary > 50000\G -- Returns detailed JSON with: -- - query_cost: total execution cost estimate -- - table_access: access method (ALL, ref, range, etc.) -- - used_key_parts: which index columns were used -- - key_length: length of the used key -- - rows_examined_per_scan: estimated rows scanned -- - filtered: percentage of rows filtered by… A close relative is AUTO_INCREMENT, which mySQL auto-generates sequential integer values for this column. Commonly used with PRIMARY KEY. A close relative is ENGINE, which specifies the MySQL storage engine. InnoDB (default) supports transactions and foreign keys. MyISAM is faster for read-heavy.