how to execute a sql in teiid
724150880 Jun 24, 2014 6:02 AMhello:
i read the chapter Planning Overview - Teiid 8.7 - Project Documentation Editor ,but i haven't understood the plan how a integrate sql execute ..
eg. i have two sybase datasources which are in multi-source mode . and when i execute a sql : select hour(start_time),count(0) from test group by hour(start_time) .
step 1: Parsing - validate syntax and convert to internal form ,so check if syntax is correct and covert to internal form : select hour(start_time) from test group by hour(start_time) ?
step 2 :Resolving - link all identifiers to metadata and functions to the function library ,check if there are function hour() in sybase translator?
step 3:Validating - validate SQL semantics based on metadata references and type signatures ,check if the sql is right by sybase metadata?
step 4:Rewriting - rewrite SQL to simplify expressions and criteria i don,t know how to rewrite the sql ? and why it need rewrite sql?
step 5:Logical plan optimization - the rewritten canonical SQL is converted into a logical plan for in-depth optimization. The Teiid optimizer is predominantly rule-based. Based upon the query structure and hints a certain rule set will be applied. These rules may trigger in turn trigger the execution of more rules. Within several rules, Teiid also takes advantage of costing information. The logical plan optimization steps can be seen by using SHOWPLAN DEBUG clause and are described in the Query Planner section. maybe this optimization decide how the sql transfer to datasource?
step 6:Processing plan conversion - the logic plan is converted into an executable form where the nodes are representative of basic processing operations. The final processing plan is displayed as the Query Plans. i didn't understand this step
so can someone explian that clearly by using my example? thanks a lot ....