MySQL Forums
Forum List  »  Optimizer & Parser

Re: Query Optimizer / SQL Translation
Posted by: Timour Katchaounov
Date: December 14, 2005 02:55AM

Hi Dave,

I have to dissapoint you a bit, there is no explicit internal representation of SQL as a
relational algebra tree with (select, join, etc.) nodes that one may find in database
textbooks. Instead the server represents queries internally as a number of interrelated
data strucutures that are created/filled-in at various stages of query processing.
If one is familiar with these data structures it is possible to extract a relational
algebra tree, but it is not a trivial task. The closest code that performs a similar
task is the code for EXPLAIN which can be found in sql/sql_select.cc. Look at the
procedures in the end of the file, after the comment "EXPLAIN handling".

Let me know what exactly you are trying to achieve, then I can give you some more
concrete suggestions for a solution.


Best regards,

Timour Katchaounov, Software Developer,
MySQL

--
Timour Katchaounov, Software Engineer - Optimizer
MySQL AB, www.mysql.com

Options: ReplyQuote


Subject
Views
Written By
Posted
3917
November 28, 2005 09:22PM
Re: Query Optimizer / SQL Translation
2266
December 14, 2005 02:55AM


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.