Disk reading does not decrease upon repeated request

Case 1:

I run a Sql query in oracle, its simple select statement in a table without an index. Information about the statistics that I received for the request, shows TABLE FULL ACCESS, 176k buffer_getsand 111k disk_reads. I ran the same query again and checked the statistics result, only the time decreased, but there were no changes in the buffers and readings. When data is cached, does time become reduced rather than being read by the buffer and disk?

Case 2:

Now I created an index for the table and executed the same query and saw the result of statistics, I got TABLE ACCESS BY INDEX and several buffers receive and read disks. when I ran the same query again, I got the same result when reading a null disk and reducing the time.

why the disc cannot be read in case 1? When I run a query, is everything cached? As far as I noticed, the disk reading remains the same in accessing the table complete and merges.

+4
source share
2 answers

How big is the table? If I simplify this, the Oracle buffer cache is a huge hash table in which each cell starts a linked list of pages.

When Oracle accesses the page, it first takes the physical address of the table block (file number and block ID) and calculates the hash value. It then moves the linked list of blocks bound to that particular hash value.

Blocks are ordered using the LRU algorithm (with touch counter). The newest blocks are at the top of the list.

: Oracle , () 5% , LRU. , "" . , , .

PS: 5%, Oracle.

PS1: , , ASM-. Oracle ( ) DIRECT. enabled, , should not . DIRECT_IO ( ), , Oracle .

0

. 1 . 2 , , , , .

0

Source: https://habr.com/ru/post/1570144/


All Articles