Cache tables

You use cache tables to store data that you access frequently but that does not change often.

A cache table can improve query performance by storing the data locally instead of accessing the data directly from the data source.
You can cache data from these data sources:
  • Db2® family
  • Informix®
  • Microsoft SQL Server
  • Oracle
  • Sybase
A cache table consists of these components:
  • A nickname on your federated database system. The nickname has the same column definitions and same data access as the data source table.
  • One or more materialized query tables that you define on the nickname. The type of materialized query tables is FEDERATED_TOOL maintained materialized query table. The materialized query table usually contains a subset of high-use data from the data source table.
  • A replication schedule for each materialized query table. The replication schedule keeps the local materialized query tables current with your data source tables. You define the replication schedule.

The following figure illustrates a cache table.

Figure 1. Cache table.
This figure shows that the components of a cache table are a nickname, materialized query tables, and a replication schedule. Data from the data source table is stored locallly. Users access the local data in the cache table by using applications.

The cache table has the same name as the nickname. You can associate a cache table with only one data source table.

When a cache table is enabled, the query optimizer directs queries to the cache table if the data that the query requests can be found in the materialized query table.