--降序索引
EODA@PROD1> drop table t purge;
Table dropped.
EODA@PROD1> set echo on
EODA@PROD1> create table t as select * from all_objects;
Table created.
EODA@PROD1> create index t_idx on t(owner,object_type,object_name);
Index created.
EODA@PROD1> begin
2 dbms_stats.gather_table_stats(user, 'T', method_opt=> 'for all indexed columns');
3 end;
4 /
PL/SQL procedure successfully completed.
EODA@PROD1> set autotrace traceonly explain
EODA@PROD1> start /tmp/opt.sql
EODA@PROD1> select owner, object_type
2 from t
3 where owner between 'T' and 'Z'
4 and object_type is not null
5 order by owner DESC, object_type DESC;
Execution Plan
----------------------------------------------------------
Plan hash value: 2685572958
-------------------------------------------------------------------------------------
| Id | Operatio
降序索引浅析
最新推荐文章于 2024-06-25 20:51:17 发布
本文通过示例分析了Oracle数据库中降序索引的使用,包括如何创建和使用降序索引,以及它们在部分升序、部分降序排序查询中的效果。通过对比不同查询计划,展示了降序索引如何影响执行效率,以及如何通过创建反向索引来优化查询性能。
摘要由CSDN通过智能技术生成