The query language processor is responsible for taking query language statements or shifting them from the English-like syntax of the query language to a form the DBMS can know. The query language processor commonly consists of two separate elements: the parser or the query optimizer.
The parsers receive query language statements to the command-line utilities or application programs and study the syntax of the statements to make sure they are right. To do this, the parsers splits a statement down into primary units of syntax and study them to make sure each statement consists of the proper component elements. If the statements follow the syntax rules, the tokens are approved to the query optimizer.
The query optimiser displays the query language statement, and tries to selected the best and most efficient way of implementing the query. To do this, the query optimizer will make various query plans in that operations are performed in dissimilar orders, and then try to compute taht plan will implement most efficiently. While making this estimation, the query optimizer might show factors like as: disk time, network time, CPU time, scanning methods or sorting methods.