zoukankan      html  css  js  c++  java
  • keep buffer pool的实验及使用

    --下面是对keep pool使用的实验及总结:

    alter system set db_keep_cache_size=100m scope=both;
    create table test(c1 int,c2 char(2000),c3 char(2000),c4 char(2000),c5 char(1000)) storage(buffer_pool keep)cache;
    insert into test values(1,'a','b','c','d');
    insert into test select * from test;    --重复多次
    analyze table test compute statistics for table for all columns;
    或exec dbms_stats.gather_table_stats(user,'X1',cascade=>true);
    select distinct c2,c3,c4,c5 from test;


    注:
    1.要想使对象真的保持在内存中,一定要让db_keep_cache_size的值大于系统中所有buffer_pool为keep的所有对象的空间之和,而且还要略大于这个空间之和,至于大多少,我不是很确定,本人只是片面的进行了简单的测试,一个194M的表,需要大约240m的空间,一个66M的表,需要85M的空间,具体情况,还需要具体测试;
    2.表进行dml操作后,一定要先进行analyze或dbms_stats.gather_table_stats(),也就是生成最新的统计信息,如果差别很大,那么也不能保证表在内存中;
    3.在我的实验里,一旦表被强行刷出内存或者因keep pool不足而被挤出内存或者数据库重新启动,即使db_keep_cache_size空间足够大,其他数据库对象属性的修改、分析及数据库的重启,都不能让该对象重新回到内存,必须对该表进行再次分析,才能使该表重新回到内存;
    4.刚才看到资料,忽然想起了keep buffer中对象的undo信息也是存储在keep pool中的,因此,第一点中keep buffer要比需要keep在keep pool中的对象所需空间之和稍大的原因,从这里找到了答案;

    Oracle & Mysql & Postgresql & MSSQL 调优 & 优化
    ----------------------------------------------------------
    《高性能SQL调优精要与案例解析》
    blog1:http://www.cnblogs.com/lhdz_bj
    blog2:http://blog.itpub.net/8484829
    blog3:http://blog.csdn.net/tuning_optmization
  • 相关阅读:
    linq教程
    linq 多表分组查询统计
    System.Diagnostics.Trace.Listeners
    linq多表join与group
    LINQ的左连接、右连接、内连接
    linq pad
    开源项目
    linq group join
    OWIN OAuth 2.0 Authorization Server
    autofac + owin + webform + mvc + webapi集成demo
  • 原文地址:https://www.cnblogs.com/lhdz_bj/p/1984645.html
Copyright © 2011-2022 走看看