Agile performance - Cache at View Level

In the previous section, you activated the cache module in your Denodo server. Now, you need to configure your views to make use of the cache.

For example, let's activate the cache in the client_with_bills view. We have two main reasons to select this view as a cached view:

  • It queries two data sources (a MySQL database and a SOAP Web Service).
  • Usually Web Service response times are worse than traditional databases response times.

How to activate cache for a view

Please, follow these steps:

  1. In the Elements Tree, double-click on the view name client_with_bills. The view schema will show in the Workspace.
  2. Click on the Options tab at the top (third tab).
  3. Under Cache mode:, check Partial. It will enable a partial cache for the client_with_bills view.
  4. Leave the rest of fields with the default values.
  5. Finally, click Save.

Now test if the cache works as expected by performing the following test:

  1. Open Tools > VQL Shell.
  2. Execute the following query (make sure you have the tutorial database selected from the drop-down Database menu): SELECT * FROM client_with_bills TRACE
  3. After the execution, click on the Execution Trace button (above the results) to see the query execution plan. You can see that the data comes directly from the different data sources.
  4. Click Execute and perform the same query again.
  5. Click on the Execution Trace button again and you will see that the data comes from the cache (displayed with a box a icon), and the execution time of the query is faster.

In the next section, you will learn more about the available cache modes. In the above example, you configured the view to use Partial mode, in the next section we will learn the the behavior of the different cache modes.