user3239652 user3239652 - 1 year ago 122
SQL Question

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?

Answer Source

Parsing is one stage in the processing of a SQL statement. When an application issues a SQL statement, the application makes a parse call to Database. During the parse call, Database:

  1. Checks the statement for syntactic and semantic validity.
  2. Determines whether the process issuing the statement has privileges to run it.
  3. Allocates a private SQL area for the statement.