Adding data caches in Data Virtualization

Last updated: Mar 17, 2025
Adding data caches in Data Virtualization

Data Virtualization Managers can create a cache entry to save query data and results and optimize query performance.

Before you begin

Ensure that you meet the following requirements:

  • You have the required permissions to run the SQL statement.
  • You are using a query that qualifies the table name with a schema name to define and create the cache entry. For more information, see Creating schemas.
  • You consider the restrictions for creating caches. For more information, see Restrictions for cache entries in Data Virtualization.

About this task

Data Virtualization users require interactive query performance to access data of any size, any format, and any source. To avoid query executions that are time-consuming, Data Virtualization Managers can create a cache entry to improve the performance by caching the result set of your queries.

Try to limit the number of cache entries since it might increase the cost of compiling and evaluating user queries, and might worsen service performance.

Procedure

  1. Go to Data > Data virtualization > Virtualization > Cache management.
  2. Click Add new cache in the Active data caches tab.
  3. Enter valid queries in the SQL editor to create your cache. Ensure that you specify a schema name in your query and leave out any SQL terminators.
  4. From the Test queries with cache tab, you can test whether the cache can match a query at run time, and then follow these steps:
    1. Enter a query in the SQL editor.
    2. Go to the Select from existing tab and choose the queries for which you want to test cache impact.
    3. In the Selected queries section, you can edit selected queries or filter queries by creation date, creator, execution time and types of query.
    4. Start the test of cache impact on selected queries by clicking Test queries.
    5. Test results are displayed in the Selected queries section. The Status column provides the following information.
      • Matched to cache: Data Virtualization determined that the cache matched with the selected queries, and if you choose to create the cache, those queries might use the cache at run time. Other near-identical caches might override the utility of the cache that you are creating. Whether query performance improves or not depends on other factors in the overall query plan.
      • Not matched to cache: Data Virtualization determined that the cache does not match the selected queries, and hence, might not have any influence on query performance.
      • Error: Data Virtualization cannot validate whether the selected queries match the cache or not. Refer to the error message for details.
    6. Click Use this cache to apply the cache to the selected queries.
  5. Click Next and set the refresh rate to prevent the cache from becoming stale by referring to the following information.
    • None, manual only: To refresh a cache manually, go to the action menu of an active cache and click Refresh now.
    • Minutes: Select the interval in minutes to refresh your cache. For example, refresh every 15 minutes.
    • Hourly: Select time (minute) of the hour to refresh your cache. For example, refresh every hour at the 30 minutes past the hour.
    • Daily: Select time of the day to refresh your cache. For example, refresh every day at 12:00 AM.
    • Weekly: Select days of the week and time of the day to refresh your cache. For example, refresh every Monday, Wednesday, and Friday at 12:00 AM.
    • Monthly: Select weeks of the month, days of the week, and time of the day to refresh your cache. For example, refresh on the first day of the month at 12:00 AM.
  6. Click Next and then enter a name for your cache.
  7. Ensure that the summary is correct, and then click Create cache.