SQL> select count(*) from example; COUNT(*)
----------
9999519SQL> select num_rows , blocks , empty_blocks from user_tables where table_name=upper('example'); NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
18 15 0SQL> analyze table example compute statistics for table;Table analyzed.SQL> select num_rows , blocks , empty_blocks from user_tables where table_name=upper('example'); NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
18 15 0
这个num_rows为什么还是18
----------
9999519SQL> select num_rows , blocks , empty_blocks from user_tables where table_name=upper('example'); NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
18 15 0SQL> analyze table example compute statistics for table;Table analyzed.SQL> select num_rows , blocks , empty_blocks from user_tables where table_name=upper('example'); NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
18 15 0
这个num_rows为什么还是18
解决方案 »
- ORACLE数据库关于时间段内数据查询的结果的查询
- Oracle由A恢复到B的脚本
- 关于ip字段的处理!
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 一个比较有意思的难题?关于多条件查询![
- 如何创建中间表,创建中间表有什么要注意的吗?
- 现在要把一个数据库中的数据导到文件中,然后再从文件中读取数据导入到另外的数据库,请问有什么好的实现方法?
- ORACLE内一个select语句,请高手解释一下
- oracle9i启动后占用CPU100%,有没有人能解决这个问题?急
- oracle字段自动加一有点感觉了,出现以下错误,请部是为何?
- 初级问题:????
- 登陆数据库:没有监听程序,是什么原因导致的
- sqlplus 文件保存路径
我这边测试没有问题
USER is "TEST"
SQL> select table_name from user_tables;TABLE_NAME
------------------------------
CHAINED_ROWS
INVALID_ROWS
AAA
EXAMPLESQL> select count(*) from example; COUNT(*)
----------
9999519SQL> select num_rows , blocks , empty_blocks from user_tables; NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------ 18 15 0
SQL> analyze table example compute statistics for table;Table analyzed.
SQL> select num_rows , blocks , empty_blocks from user_tables; NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------ 18 15 0
从前example表中 是存在 18 条数据
昨天测试了,输入了 很多数据进去了,数据都很简单,但是analyze后结果如下
表结构SQL> desc example
Name Null? Type
----------------------------------------- -------- ----------------------------
COL_1 NOT NULL NUMBER
COL_2 NUMBER
COL_3 TIMESTAMP(6)
ANALYZE TABLE example DELETE STATISTICS
analyze table example compute statistics for table;
---------- ---------- ------------ 18 15 0SQL> analyze table example compute statistics for table;Table analyzed.SQL> select num_rows , blocks , empty_blocks from user_tables; NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------ 18 15 0不会是我的example是个 分区表 造成的吧!
我记得是这样子的
create table example
( col_1 number constraint example_pk primary key using index tablespace tbsindex ,col_2 number , col_3 timestamp)
partition by range(col_2)(
partition part_1 values less than (10) tablespace example,
partition part_2 values less than (20) tablespace example,
partition part_3 values less than (maxvalue) tablespace tbsindex)
SELECT DBMS_METADATA.GET_DDL('TABLE', 'YOUR_TABLE_NAME', 'YOUR_SCHAME_NAME')
FROM DUAL;
create table example
( col_1 number constraint example_pk primary key using index tablespace tbs1 ,col_2 number , col_3 timestamp)
partition by range(col_2)(
partition part_1 values less than (10) tablespace example,
partition part_2 values less than (20) tablespace example,
partition part_3 values less than (maxvalue) tablespace tbs1);INSERT INTO example
VALUES (1,2,SYSTIMESTAMP);
INSERT INTO example
VALUES (10,25,SYSTIMESTAMP);
COMMIT;SELECT count(*) FROM example;
COUNT(*)
----------
2select num_rows , blocks , empty_blocks from user_tables where table_name=upper('example');
NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
2 10 14INSERT INTO example
VALUES (11,36,SYSTIMESTAMP);
INSERT INTO example
VALUES (21,16,SYSTIMESTAMP);
INSERT INTO example
VALUES (31,96,SYSTIMESTAMP);
COMMIT;SELECT count(*) FROM example;
COUNT(*)
----------
5select num_rows , blocks , empty_blocks from user_tables where table_name=upper('example');
NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
2 10 14analyze table example compute statistics for table;select num_rows , blocks , empty_blocks from user_tables where table_name=upper('example');
NUM_ROWS BLOCKS EMPTY_BLOCKS
---------- ---------- ------------
5 15 9我这边似乎没问题呀
analyze table example delete statistics ;
analyze table example compute statistics for table;