Sql Processing Steps
Whenever you issue a sequel statement it goes through a series of steps.
- Syntax check - grammer mistake
- Semantic check - Sees whether Sql statement is valid. That means whatever the tables the user is refereeing are already there in the database.
- Shared pool Check - if the same kind of Sql has been executed before then it finds that particular Sql when and it directly executes the statement.
- Optimization (Generation of multiple execution plans) - Let Suppose if it didn't find a similar sequence statement in shred prool, then it goes to fourth phase Optimization, where statement is generation of multiple execution plans.
- Rows / Data Generation - on basis of best execution plan SQL shows the result set.