This article deals with parsing techniques involved in executing the sql server query. Nowadays, stored procedures forms a strong back ground in accessing the database. Why is it so???? how it's related to my query parsing technique
If we think about the query execution there are various steps involved in executing the query such as,
- Lexical phase - Code break up will happen at this stage. All my code breaks up as individual tokens.
Let us consider
- Syntax analysis - Here my code gets checked for its syntax.
In C program we have a standard rule like, if i want to declare a variable we have to specify the variable and followed by variable name and you can specify the values(initialization) followed by semicolor (
select colname from tablename where condition on the columns
- Semantic phase - Here the semantics will be checked. For example i am trying to execute a simple piece of code in c#,
Console.Writeline(a.ToString()); int a;
- Intermediate code generation - Its the fourth stage where an intermediate code will be generated by the compiler its like converting the high level code to machine level code.
- Code Optimization - My compiler will holds some optimization technique to optimize the code so that we can achieve effective execution of our code.
- Optimized code generation - After code optimization a final code will be generated which can be used to retrieve the data. In sql server this optimized code will be stored and used frequently to fetch the data from the database.
- Code execution - The optimized code gets executed against the database engine.
Please provide me your valuable feedback regarding this article.
Venkatesan Prabu . J