The Salesforce driver can implement a client-side data cache for improved performance. Data is cached from the remote data source to the local machine on which the driver is located.
The driver caches data on a per-table basis, as opposed to caching the result of a particular query. This allows the caches to be queried, filtered, and sorted in other queries. Once a cache is created, its use is transparent to the application. For example, if a cache is created on the Account table, all subsequent queries that reference Account access the Account cache. Disabling or dropping the cache allows references to the Account table to access the remote data again. Because the use of the cache is transparent, no changes to the application are required to take advantage of the cache.
You must create a cache before it can be populated; caches are not created automatically. After you have created a cache on a table, the cache is populated as a result of the next operation on the table. For example, after creating a cache on Account, data is returned from the Salesforce data source and stored locally in the cache when you first execute the following statement:
SELECT ROWID, SYS_NAME FROM Account
Any subsequent queries against the Account table return data from the cache, which reduces response time. SQL queries can access both cached data and remote data (data stored in Salesforce that has not been assigned to a cache) in the same statement.
The caches maintained by the Salesforce driver are write-through caches. This means that, for any operation that modifies data in a table that is cached, the driver performs the operation on the remote data first and then updates the cache.
To create, modify, refresh, or delete client-side data caches, use the following SQL statement extensions:
Create Cache
Alter Cache
Refresh Cache
Drop Cache
See "Supported SQL Statements and Extensions" for descriptions of the syntax of these extensions.