Jordi Gomez · Dec 10, 2018

When is mandatory to execute a "Purge queries"?

Dear all,

In our application made in Caché object script, when we deploy some classes modified we have the option of calling "Purge queries" feature of Caché.

We only were doing this call when a %Persistent class definition (table) was modified, as we assume that no other changes affect the cached queries and we don't  want to purge them by default, as the first run of a query becomes slow.

We had a case where no table definition was changed but a purge queries was the solution.

Do you know if any other change could affect the cached queries and a purge queries is necessary? 


0 204
Discussion (3)2
Log in or sign up to continue

At the very least changes in:

  • Query elements of any class
  • ClassMethods with [SqlProc] modifier

May require a query purge.

Ok, many thanks.

You are confirming what we suspect.

The answer to your question is 'almost never'.  If you run TuneTable on your class/table then you will be required to do a purge so the optimizer can pick up the changes.  Aside from that, the Caché engine should handle all purges automatically.  If you change a class and compile it, that compilation should trigger a purge of the appropriate cached queries.  If you are finding that it does not, then please contact the WRC so we can get this fixed.