Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, W..

Asked: September 26, 2019 - 9:04 pm UTC

Last updated: September 27, 2019 - 4:21 am UTC

Version: 11.2.0.4

Viewed 1000+ times

You Asked

Hi Tom
We have a question on result cache behavior in 11.2g that divides our office and we are hoping you can help us. We could not find a clear answer to this in the documentation.

The question is if writing to result cache from Query A can cause contention (enq: RC – Result Cache: Contention) for Query B which can be reading and writing from/to result cache.
In our case these queries are not using the same tables at all.

In other words is updating result cache locks the entire result cache or only a relevant part of the result cache.

thanks.

and Connor said...

In 11.2, we have a single RC latch, and thus *updating* the result cache will typically block other operations that also wish to update the result cache at the same time.

For reading from the cache, the latch can be obtained in a shared mode, so unless you are referring to the *same* cache object, readers and writers can co-exist. (This was not the case in 11.1 where things were not as good)

A lot of people see result cache as "Hey, lets add it to every single query we have". It is generally a bad idea to do this :-) It is targetted for queries that

- are against tables that do not change rapidly,
- the time to execute is much larger than without caching



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database