Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can we implement result_cache for frequently changing queries?

BS2012Dec 24 2014 — edited Dec 24 2014

Hi Everyone,

My DB version is

BANNER                                                                        

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production    

PL/SQL Release 11.2.0.3.0 - Production                                          

CORE 11.2.0.3.0 Production                                                        

TNS for Linux: Version 11.2.0.3.0 - Production                                  

NLSRTL Version 11.2.0.3.0 - Production                                          

Now we have result_cache feature available, which is very useful. I've tested this from different sessions as well, we can see result_cache inside the execution plan. But if we have different sort of values passed to the same query then it's not working I guess. What about few app side queries? These queries will search from DB based upon some condition (e.g. fetch the employees from department 30, next time it might have to fetch for department 40). So when the value will change, there is no benefit of caching the result set. I guess this is the trade off for result_cache, if not then how can we implement the same for these kinda queries? Btw till what time the result_cache will hold the results? This is not session dependent of course, if I'll provide the result_cache hint to the same query from another session then it's going for result that is cached earlier from some other session. Please clear my doubts.


Regards,

BS2012.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 21 2015
Added on Dec 24 2014
3 comments
1,442 views