Caching results with the client-side result cache
In this recipe we will see how to enable and use the client-side result cache to reach significant improvement in repeatedly executing complex queries.
Getting ready
To enable the client result cache feature in a database, we need to alter the CLIENT_RESULT_CACHE_SIZE
parameter and set a size for caching larger than zero (the default value). This parameter specifies the size in bytes used by all the client processes as the maximum size of the client per-process result set cache.
To do so we need to execute the following commands, querying for the actual value of the parameter:
CONNNECT / AS SYSDBA SHOW PARAMETER CLIENT_RESULT_CACHE_SIZE
If we need to alter the size, because it is set to zero, or if we want to change the actual size—we can use the following commands. Once we set the size for the client result cache to 5 MB, we restart the instance to enable the modifications:
ALTER SYSTEM SET CLIENT_RESULT_CACHE_SIZE=5M SCOPE=SPFILE; SHUTDOWN...