Information icon IBM Information Server, Version 8.1
Feedback

Query optimization

The federated database optimizes the performance of SQL queries against heterogeneous data sources by leveraging the DB2® query optimizer and by determining when it is faster to process a query on the data source or on the federated database.

Compensation

The process of compensation determines where a federated query will be handled. The federated database compensates for lack of functionality at the data source in two ways:
  • It can request that the data source use one or more operations that are equivalent to the DB2 function in the query.
  • It can return the set of data to the federated server, and perform the function locally.

For relational data sources, each type of relational database management system supports a subset of the international SQL standard. If an SQL construct is found in the DB2 SQL dialect but not in the relational data source dialect, the federated server can implement this construct on behalf of the data source.

Even data sources with weak SQL support or no SQL support will benefit from compensation.

The query optimizer

As part of the SQL compiler process, the query optimizer analyzes a query. The compiler develops alternative strategies, called access plans, for processing the query.

Access plans might call for the query to be processed by the data source, the federated server, or partly by each.

The query optimizer uses information in the wrapper and global database catalog to evaluate query access plans. The optimizer decomposes the query into segments that are called query fragments. Typically it is more efficient to push down a query fragment to a data source if the data source can process the fragment. However, the query optimizer evaluates other factors:

The query optimizer generates access plan alternatives for processing a query fragment. The plan alternatives perform varying amounts of work locally on the federated server and on the remote data sources. The query optimizer chooses the plan with the least resource consumption cost.

Related concepts
The federated server and database
Wrappers and other federated objects
Two-phase commit for federated transactions
Rational Data Architect

PDF This topic is also in the IBM Information Server Introduction.

Update icon Last updated: 2008-09-15