Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does parsing a query mean?

Most relational databases handles a JDBC / SQL query in four steps:

  1. Parse the incoming SQL query
  2. Compile the SQL query
  3. Plan/optimize the data acquisition path
  4. Execute the optimized query / acquire and return data

I want to know what does "parse the incoming query" really mean? And what does "plan/optimize data acquisition path" mean?

like image 629
user3239652 Avatar asked Aug 22 '14 19:08

user3239652


People also ask

What does parsing mean in SQL?

The parsing stage involves separating the pieces of a SQL statement into a data structure that other routines can process. The database parses a statement when instructed by the application, which means that only the application, and not the database itself, can reduce the number of parses.

What is parsing and translation in query processing?

Parsing and Translation As query processing includes certain activities for data retrieval. Initially, the given user queries get translated in high-level database languages such as SQL. It gets translated into expressions that can be further used at the physical level of the file system.

What is query parsing in Oracle?

Parsing. This is the first step in the processing of any statement in Oracle. Parsing is the act of breaking the submitted statement down into its component parts ? determining what type of statement it is (query, DML, DDL) and performing various checks on it.

What is parser in SQL Server?

PARSE() function in SQL Server PARSE() function can convert any string value to Numeric or Date/Time format. If passed string value cannot be converted to Numeric or Date/Time format, it will result to an error. PARSE() function relies on Common Language Runtime to convert the string value.


1 Answers

  1. Parsing means examining the characters input and recognizing it as a command or statement by looking through the characters for keywords and identifiers, ignoring comments, arranging quoted portions as string constants, and matching the overall structure to the language syntax making sense of it all.

  2. Plan/optimize means figure out the best way (of all the possible ways) to determine the result, usually with respect to execution time. It could also mean minimizing the number of locks needed. Maybe some parts of the query can be ignored (where ... and 1 == 1) or a table doesn't need to be accessed at all, etc.

like image 114
wallyk Avatar answered Oct 05 '22 23:10

wallyk