原帖由 elysium_H 于 2010-9-15 15:49 发表
2.是不是可以这样理解,执行alter table test cache后,通过全表扫描把test的全表数据cache到内存中,之后所有的DML操作引起的数据变化,在提交后都会在内存中保留结果,即缓存中test表数据,是DB文件中test表数据的全镜像
原帖由 elysium_H 于 2010-9-15 11:24 发表
3.如果会被移出内存,那么使用alter table test storge(buffer_pool keep) cache;是不是可以避免这个问题?
原帖由 Yong Huang 于 2010-9-17 03:26 发表
Keep pool is really just a separate pool. I don't think there's anything magic. I hope somebody can test. Just allocate a few big tables to a small keep pool so the pool is definitely smaller than the total size of these few tables. Full scan one table. Find their blocks in the pool. Scan another. See if the first table's blocks have disappeared from the keep pool. I think they will.
Yong Huang
原帖由 sundog315 于 2010-9-17 08:52 发表
http://download.oracle.com/docs/ ... 1/memory.htm#i30935
7.2.4 Considering Multiple Buffer Pools
Multiple buffer pools let you address these differences. You can use a KEEP buffer pool to maintain frequently accessed segments in the buffer cache, and a RECYCLE buffer pool to prevent objects from consuming unnecessary space in the cache. When an object is associated with a cache, all blocks from that object are placed in that cache. Oracle Database maintains a DEFAULT buffer pool for objects that have not been assigned to a specific buffer pool. The default buffer pool is of size DB_CACHE_SIZE. Each buffer pool uses the same Least Recently Used (LRU) replacement policy (for example, if the KEEP pool is not large enough to store all of the segments allocated to it, then the oldest blocks age out of the cache).
原帖由 sundog315 于 2010-9-17 11:37 发表
1.select count(*) from test_t1;
test_t1的内容位于LRU的冷端
2.select count(*) from test_t2;
还可以放下,比test_t1靠近热端
3.循环select count(*) from test_t1;
结果不变
4.select count(*) from test_t3;
从冷端查找,刷掉test_t1
所以,这个就是为什么觉得是先进先出的原因。其实并不是先进先出。
欢迎光临 ITPUB论坛-专业的IT技术社区 (http://www.itpub.net/) | Powered by Discuz! X3.2 |