You can route queries to the materialized query table for the cache
table or to data source by routing the queries to the nickname.
Before you begin
Before
you begin
- A cache table must exist for the nickname that you query.
- Enable caching to the materialized query table.
- Set the following database configuration parameters:
- Materialized table type for optimization (DFT_MTTB_TYPES)
- Query optimization class (DFT_QUERYOPT)
Use the Configure Database notebook in the Control
Center or the command line to set these parameters.
About this task
Procedure
To change the routing for queries:
Procedure
- In the Control Center, expand the Cache Objects folder
and the Cache Tables folder.
- Right-click the appropriate cache table and click Properties.
- Select the materialized query table and click Check
Status.
- Select where you want the queries to route the queries:
- Select Route to the materialized query table.
All queries for the data source are sent to the materialized query table.
If the data in the materialized query table cannot satisfy the query, the
query is then routed to the data source using the nickname.
- Select Route to the nickname. All queries are
sent to the data source by using the nickname. The materialized query table
is changed to a regular database table. Replication to the materialized query
table continues unless you disable caching.
- To change the routing immediately, select the Remove
all cached dynamic SQL statements check box. The dynamic SQL statements
that are currently in the package cache are deleted.
- Click OK.
What to do next
You can also access the Cache Table Properties window from a nickname
object. Right-click the nickname and click
Caching.