Performance of queries on virtual tables

The performance of queries on virtual tables depends on the type of query. Accelerating the query with Informix® Warehouse Accelerator can improve performance.

The performance of queries on virtual tables is similar in most cases to the performance of queries that run TimeSeries functions on base tables. For example, the Clip function is faster applied through a virtual table than directly on a time series. However, it is faster to run the Apply or the Transpose routines on a time series than to run them through a virtual table by using the TSCreateExpressionVirtualTab procedure.

If you want to query large amounts of time series data, the performance of queries on virtual tables that are accelerated by Informix Warehouse Accelerator is significantly faster than any other type of query. You can control how much of the virtual table is loaded into the data mart to further improve query performance. You can easily change which parts of the virtual table are in the data mart. For example, you create a virtual table that contains three years of time series data. You create a data mart that is based on the virtual table. You define virtual partitions for the data mart so that you can quickly refresh the data mart. You define time windows for the first three months of each year of data and load that data into the data mart. You run analytic queries on the data through the accelerator. Then you change the time window to the second three months of each year and run analytic queries on that data.

You can enhance the performance of your virtual tables by performing the following tasks:
  • Create the virtual table as a fragmented table and enable PDQ so that queries are run in parallel. The base table must be fragmented by expression.
  • Create an index on the key column of the base table. If the table has more than one column in the key, create a composite index that consists of all key columns.
  • Run UPDATE STATISTICS on the base table and on its key columns after any load or delete operation:
    UPDATE STATISTICS HIGH FOR TABLE daily_stocks;
    
    UPDATE STATISTICS HIGH FOR TABLE daily_stocks (stock_id);

    By default, statistics are automatically updated once a week.