Article
· Jun 15, 2023 1m read

How to delete the query cache programmatically

InterSystems FAQ rubric

Query cache can be purged programmatically using the Purge* methods of the %SYSTEM.SQL class.

*For details of each method, please refer to the following documents.

%SYSTEM.SQL class【IRIS】

%SYSTEM.SQL class

① When deleting all query caches in the system

Do $SYSTEM.SQL.PurgeAllNamespaces()


② When deleting the query cache in the namespace

// delete all cached queries in namespace
Do $SYSTEM.SQL.Purge()

// when deleting the query cache specified by date
// the following deletes the cache not used in the last 30 days

Do $SYSTEM.SQL.Purge(30) 

③ When specifying and deleting the query cache

Do $SYSTEM.SQL.PurgeCQClass("%sqlcq.USER.cls13")


④ When deleting the query cache for a specific table

Do $SYSTEM.SQL.PurgeForTable("MedLab.Patient")

Discussion (0)1
Log in or sign up to continue