1,建表
create table t_more_col(col1 int,col2 int,col3 int,col4 int,col5 int,col6 int,
col7 i nt,col8 int,col9 int, col10 int);
2,查表
select * from user_tables where table_name=upper('t_more_col')
3,插表
declare
type typ_tab_col1 is table of pls_integer index by pls_integer;
typ_tab_col1_1 typ_tab_col1;
begin
for i in 1..1000000 loop
typ_tab_col1_1(i):=i;
end loop;
forall i in 1..1000000
insert into t_more_col values(typ_tab_col1_1(i),null,null,null,null,null,null,null,null,null);
commit;
end;
4,--分析表
exec dbms_stats.gather_table_stats('SCOTT','T_MORE_COL');
5,查表的记录数
select count(*) from t_more_col
6,多次运行统计语句,我作了个表格
6,小结
--为何表的记录数与分析表的记录数不一致呢,再分析下表,看下
--小结:1,分析表每次的结果稍有不同,所以说oracle每次分析是基于什么呢,
-- 2,每次分析表到底分析多大比例呢,收集到的数据比较准确呢
-- 3,所以每次表收集要注意些什么呢
QQ截图20120923110452.gif
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-744852/
,如需转载,请注明出处,否则将追究法律责任。