MySQL Forums
Forum List  »  Optimizer & Parser

Making the EXPLAIN EXTENDED query runnable
Posted by: Niklas Saers
Date: October 31, 2007 07:07AM

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

Options: ReplyQuote


Subject
Views
Written By
Posted
Making the EXPLAIN EXTENDED query runnable
3803
October 31, 2007 07:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.