Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Caching within packages..
Joachim Zobel wrote:
> On Tue, 09 Dec 2003 22:43:37 +0000, NetComrade wrote:
>
>
>>Either one of o'reilly books, or some other book, talked about how if >>you declare a function/procedure as part of a function, you can cache >>objects in an array for the life of a session, so u don't have to make >>a trip to a table again.. anyone remembers which one?
But you can't eliminate the context switch and that's probably what the OP really meant by "trip". I have seen some circumstances where caching a lookup table in memory this way can produce a dramatic performance improvement. There are times when the answer is very time consuming to produce as well. Why bother inserting those results in a global temporary table and querying from there when the in memory solution is so easy? With the introduction of associative tables in 9.2 it's been made even easier.
Of course the other posters concerns about what happens if the table being cached is modified has to be addressed. In reality, there are many times when you know the data cannot be changing or you just don't care as long as your cache is consistent with one point in time.
-- Richard KuhlerReceived on Wed Dec 10 2003 - 15:08:15 CST