The LRU Algorithm and Full Table Scans (81)

tsinglee發表於2007-10-23

When the user process is performing a full table scan, it reads the blocks of the table
into buffers and puts them on the LRU end (instead of the MRU end) of the LRU list.
This is because a fully scanned table usually is needed only briefly, so the blocks
should be moved out quickly to leave more frequently used blocks in the cache.
You can control this default behavior of blocks involved in table scans on a
table-by-table basis. To specify that blocks of the table are to be placed at the MRU end
of the list during a full table scan, use the CACHE clause when creating or altering a
table or cluster. You can specify this behavior for small lookup tables or large static
historical tables to avoid I/O on subsequent accesses of the table.

當使用者進行全表掃描時 ,讀取資料庫至buffer , 並且把他們放在lru末尾 , 以便儘快將這些資料塊
age out, 可以用cache語句將該表存在於MRU .

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-978177/,如需轉載,請註明出處,否則將追究法律責任。

相關文章