Steps in query processing

Adaptive Server processes a query in these steps:

  1. The query is parsed and normalized. The parser ensures that the SQL syntax is correct. Normalization ensures that all the objects referenced in the query exist. Permissions are checked to ensure that the user has permission to access all tables and columns in the query.

  2. Preprocessing changes some search arguments to an optimized form and adds optimized search arguments and join clauses.

  3. As the query is optimized, each part of the query is analyzed, and the best query plan is chosen. Optimization includes:

  4. The chosen query plan is compiled.

  5. The query is executed, and the results are returned to the user.