Search

13.2. Planning Overview

download PDF
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 13.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 13.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.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.