Hi,
on
http://www.mysqlperformanceblog.com/2006/07/ the query
SELECT * FROM sbtest WHERE id IN (SELECT id FROM sbtest WHERE id BETWEEN 1 AND 10);
gets transformed to:
SELECT `test`.`sbtest`.`id` AS `id`,`test`.`sbtest`.`k` AS `k`,`test`.`sbtest`.`c` AS `c`,`test`.`sbtest`.`pad` AS `pad` FROM `test`.`sbtest` WHERE <in_optimizer>(`test`.`sbtest`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`sbtest`.`id`) IN sbtest ON PRIMARY WHERE (`test`.`sbtest`.`id` BETWEEN 1 AND 10))));
I want to use this EXPLAIN EXTENDED output to get these queries that make my life parsing any SELECT query much easier. :-) I would like to take the transformed query and execute it. What I would like to know is:
- What does <in_optimizer>, <exists>, <primary_index_lookup> and <cache> mean? Would it be safe to strip these away, or should I replace them with something?
- ON PRIMARY is not a syntax I recognize, what does this mean/where can I read more about it?
- Is there any way I can persuade the optimizer to give me back a query that will run if I repeat it?
Cheers
Nik