The information provided applies to the Informix Server Version 11.70.xC4 and later.
In the last blog entry on Continuous Acceleration during Data Refresh I said that the old data mart can be dropped "as soon as the last query utilizing it has completed". This obviously raises the question, how to be sure that there is no longer a query in need of the old data mart. While with the current releases it is not possible to directly determine which data marts really are in use by running queries, this blog entry describes a method to ensure that an old data mart is no longer in use and can be dropped after the new data mart has been created.
In general, the Informix Warehouse Accelerator executes queries serially, one query after another, but using full parallelism for each single query. Compared to the Informix Server, this corresponds to strictly obeying a setting of PDQPRIORITY to 100, giving all CPU resources to the single query currently being executed. With the accelerator there is a small overlap in that the worker node(s) of the accelerator can start working on the next query while the coordinator node is still performing the final stages of the previous query, like final sorting of the query result and sending the result to the Informix Server. But the time consuming part of query execution is done in the worker node(s), and is done one query at a time. If the accelerator receives new queries before the query currently being executed has finished, it will queue the newly arrived queries in FIFO fashion and serve them subsequently.
We can use this behavior described above in connection with the knowledge about continuous availability described in the previous blog entry to determine, when an old data mart is no longer needed. Even though the Informix Server will automatically switch to using only the new data mart as soon as it has been loaded and became active, there might still be older queries queued up that need the old data mart once it is their turn for execution. Dropping the old data mart too early would cause such queries to fail miserably.
After the load of the new data mart has completed and the new data mart has become active, as administrator we now can issue a simple test query using the data mart. As with all other queries, Informix Server will automatically decide to use the new data mart instead of the old one for this test query. With the queries in the queue being handled in FIFO fashion, earlier queries, possibly needing the old data mart, will be ahead in the queue and will be executed before our test query. Once our test query has finished and returned the result, we know that no older query needing the old data mart can still be in the queue of the accelerator. The old data mart is no longer needed and now can be dropped safely.
To exclude any doubt about whether our test query really got executed by the accelerator (and not by the Informix Server due to automatic fallback in case of an issue), the fallback option can be turned off for the test query. This is done with a setting of '5' for the session environment use_dwa. With this setting, queries that cannot be accelerated for any reason will return an error rather than falling back to execution by the Informix Server. For more information on setting the use_dwa session environment see the earlier blog entry "use_dwa" Environment Setting. With this setting, if our test query returns the expected result and not an error, we can be sure that it was executed by the accelerator.