2023-06-09
数据库统计命令的差异
ERP数据库,由于日常更新数量比较大,导致某些业务查询的时候速度比较慢,体验不好。
而我使用
dbms_stats.gather_table_stats(v_current_user,t_org_tree, estimate_percent => 100,cascade=>TRUE, method_opt => 'FOR ALL COLUMNS SIZE AUTO',degree =>10);
dbms_stats.gather_table_stats(v_current_user,t_org_baseunit, estimate_percent => 100,cascade=>TRUE, method_opt => 'FOR ALL COLUMNS SIZE AUTO',degree =>10);
dbms_stats.gather_index_stats(v_current_user,t_indexname, estimate_percent => 100,degree =>6);
后,同事反馈没有改善。
而同事执行了
analyze table t_org_tree compute statistics
analyze table t_org_baseunit compute statistics
后居然有改善。
我的问题是dbms_stats.gather_table_stats这个应该是可以替代analyze table的方法,但是为什么同事反馈执行后没有改善呢
我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
墨值悬赏

评论
