Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle cache
"John L. Laine" wrote:
>
>
> Walter T Rejuney wrote:
>
>> When a DML which performs an insert occurs, the engine will parse
>> the
>> statement and then build the row for insertion into the logical
>> table
>> located within the physical tablespace. So far so good.
>>
>> Question: If a query for that same row occurs almost immediately
>> afterwards will Oracle physically read the table to get the values
>> or
>> will it recognize that the values are already in memory and pass the
>>
>> memory contents back to the caller?
>
> If you do a INSERT and then SELECT, your update is Probably still in
> the Buffer Pool, and since it is the same session, your select will
> see the new row and retrieve it from the buffer pool.
> This gives you a chance to examine the results of your
> INSERT/UPDATE/DELETE statement, and if you change your mind, you can
> then execute a ROLLBACK.
> Other sessions connected to the database, will not see the change
> until you COMMIT.
>
> The buffer pool is dynamically managed, so it depends upon how much
> other activity is hitting it, and what the settings are, as to how
> long a datum is retained in it.
The SELECT would be performed by a session that is not the same one as the session that performed the insert (and commit). Would that make a difference? Would it still get the row from cache instead of from a physical read as long as the information hasn't aged out of cache? Received on Thu Dec 21 2000 - 09:30:35 CST