This is an old revision of the document!


Administration: Optimizing Queries

Query Plans

Anatomy of a Query Plan

An Omnidex query plan is designed to provide all of the essential information needed to understand how a query will be processed, as well as basic suggestions about how to further optimize the query. A great deal can be learned by reviewing the query plan, and it is always the first step in understanding Omnidex query performance.

A query plan consists of two sections: the Summary and the Details. The Summary section shows the SQL statement, the version of Omnidex, any optimization settings or warnings that affect the query, and even occasional suggestions for optimizing the query. The Details section shows the steps that will be executed to satisfy the query. Steps are executed in the order displayed, and are indented as needed to show loops of instructions. The example below shows the skeleton of a query plan:

----------------------------------- SUMMARY -----------------------------------
<SQL Statement>

Version:      <Omnidex version>
Request Opt:  <Requested optimization settings>
Optimization: <Actual optimization settings>
Warnings:     <Warning flags>
Notes:        <Optimization notes>
----------------------------------- DETAILS -----------------------------------
<Query processing step 1>
<Query processing step 2>
<Query processing step 3>
...
-------------------------------------------------------------------------------

The SUMMARY Section

The Summary section describes the SQL Statement and provides general notes and flags about the query. These included optimization settings and recommendations. The Summary section is the first place to look when evaluating the optimization of a query.

SQL Statement

The SQL Statement being explained is shown, formatted for easy viewing.

Version

The version of Omnidex, including the compilation timestamp. This is important as optimization can be different between versions of Omnidex.

Required Optimization

If specific optimization was required when the query was run, then these settings are shown here. If no special optimization was required, then this line is omitted.

The specific optimizations that can be required are:

Setting Description
Setting Description
NO_XREF_FILES Do not create Cross-Reference files when processing this query. Cross-Reference files are sometimes used to optimize complex, many-to-many table relationships, but they generally cause a query to take a lot of time, especially on large databases.
NO_UNOPTIMIZED_CRITERIA Do not allow any criteria to be processed without the use of Omnidex indexing.
NO_CARTESIAN_PRODUCTS Do not allow Cartesian Joins. Cartesian Joins occur when tables are joined together without any join criteria. While there are rare cases when Cartesian Joins are desireable, they are usually an indication of missing join criteria.
NO_UNOPTIMIZED_AGGREGATIONS Do not allow any aggregations to be processed without the use of Omnidex indexing.
NO_UNOPTIMIZED_SORTS Do not allow any sorts to be processed without the use of Omnidex indexing.
NO_SEQUENTIAL_SCANS Do not allow any sequential table scans.
NO_SEQUENTIAL_TABLE_JOINS Do not allow any sequential table joins. A sequential table join indicates that all rows in the second table will be scanned sequentially for each row in the first table. This is the most inefficient way to perform a join, and is only necessary when Omnidex indexing, underlying database indexing, table caching and sort/merging cannot be used.
NO_GRID_AGGREGATIONS Do not allow any aggregations to be performed on the grid controller that require reaggregating data on the grid controller.
Actual Optimization
Warning Flags
Notes

The DETAILS Section

Query processing steps

Additional Resources

See also:

 
Back to top
admin/optimization/plans/reference.1328209130.txt.gz ยท Last modified: 2016/06/28 22:38 (external edit)