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 count(*) from test where object_id=10 and owner='SYS';
COUNT(*)
----------
4194304
create table test4 as (select * from (select * from test where object_id=10 and owner='SYS') where rownum<100001);
SQL> select count(*) from test4;
COUNT(*)
----------
100000
update test4 set owner='SCOTT';
SQL> insert into test select * from test4;
100000 rows created.
SQL> commit;
Commit complete.
SQL>
组合索引和单列索引效率对比
最新推荐文章于 2025-02-01 19:00:06 发布