In this section: |
The SQL Translator improves query performance by generating optimized code that enables the underlying retrieval engine to access the selected records directly, without scanning all segment instances.
For more information about index optimization and optimized join statements, see your Server documentation for your platform.
The SQL Translator accepts joins in SQL syntax. SQL language joins have no implied direction. The concepts of host and cross-referenced files do not exist in SQL.
The SQL Translator analyzes each join to identify efficient implementation. First, it assigns costs to the candidate joins in the query:
The Translator then uses these costs to build a join structure for the query. The order of the tables in the FROM clause of the query influences the first two phases of the join analysis:
If the analysis results in joining to a table that cannot participate as a cross-referenced file according to FOCUS rules (because it lacks an index, for example), the Translator generates code to build an indexed HOLD file, and implements the join with this file. However, the HOLD file does not participate in the analysis of join order.