--- [EMAIL PROTECTED] wrote:
> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > 
> > What is the recommended way to match a TK_COLUMN Expr from 
> > a Select's pEList with its corresponding Select.pSrc 
> > SrcList_item? 
> > 
> > Do you forsee any technical problem with recursively descending 
> > the entire parse tree and calling sqlite3SelectResolve()
> > on every nested Select prior to any code generation in 
> > order to perform high-level AST manipulation?  
> > 
> > I would like to do a number of AST transformations before any
> > VDBE code is generated, but I still lack a clear understanding
> > of how to reliably map a TK_COLUMN Expr with its associated
> > SrcList_item.
> > 
> 
> Please explain to me more about what you are doing.  What
> is an AST manipulation?
> --
> D. Richard Hipp   <[EMAIL PROTECTED]>

AST = abstract syntax tree; the parse tree of the SQL expression
in this case.  I wish to perform transformations on the entire 
SQL expression parse tree prior to VDBE code generation in order 
to produce faster executing SQL in certain cases. i.e., via SQL 
source-to-source transforms.

One problem I have is that the entire tree has to be resolved 
prior to having some of the more complicated SQL transformations 
taking place. Right now in SQLite the expression resolving and code 
generation is done in the same pass. This complicates things
for tree manipulation, and makes writing optimization passes
more difficult.

Here is just one example of an SQL-level optimization that could be made:

 http://www.mail-archive.com/sqlite-users@sqlite.org/msg13950.html

Many other types of source-level optimization opportunities exist.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to