Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

14.2. Planning Overview

When the query engine receives an incoming SQL query it performs the following operations.
  1. Parsing - syntax is validated and converted to internal form.
  2. Resolving - all identifiers are linked to metadata, and functions are linked to the function library.
  3. Validating - SQL semantics are validated based on metadata references and type signatures.
  4. Rewriting - SQL is rewritten to simplify expressions and criteria.
  5. Logical plan optimization - the rewritten canonical SQL is converted into a logical plan for in-depth optimization. The JBoss Data Virtualization optimizer is predominantly rule-based. Based upon the query structure and hints, a certain rule set will be applied. These rules may in turn trigger the execution of more rules. Within several rules, JBoss Data Virtualization also takes advantage of costing information. The logical plan optimization steps can be seen by using the SHOWPLAN DEBUG clause and are described in Section 14.9.1, “Query Planner”.
  6. Processing plan conversion - the logic plan is converted into an executable form where the nodes are representative of basic processing operations. The final processing plan is displayed as the query plan. See Section 14.8.1, “Query Plans”.
The logical query plan is a tree of operations used to transform data in source tables to the expected result set. In the tree, data flows from the bottom (tables) to the top (output).
The primary logical operations and their SQL equivalents are:
  • select - select or filter rows based on a criteria,
  • project - project or compute column values,
  • join,
  • source - retrieve data from a table,
  • sort - ORDER BY,
  • duplicate removal - SELECT DISTINCT,
  • group - GROUP BY, and
  • union - UNION.