<pre name="code" class="sql">SQL> create table test as select * from dba_objects;
Table created.
select * from test where object_id=10 and OWNER='SYS';
SQL> select count(*) from test where object_id=10;
COUNT(*)
----------
1
SQL> select count(*) from test;
COUNT(*)
----------
74443
模拟插入object_id=10 and OWNER='SYS'的记录
SQL> select object_id,owner,count(*) from test2 group by object_id,owner having object_id=10;
OBJECT_ID OWNER COUNT(*)
---------- ------------------------------ ----------
10 TEST 72636
10 SYS 10003
SQL> select count(*) from test2;
COUNT(*)
----------
1578831
SQL> create index test2_idx1 on test2(object_id);
索引已创建。
分析下表:
BEGIN
DBMS_STATS.GATHER_TABLE_STATS(ownname => 'TEST',
TABLE ACCESS BY INDEX ROWID前面的星号
最新推荐文章于 2024-04-03 06:23:56 发布