Home > Database > Mysql Tutorial > body text

Oracle 中的复合索引谁放在第一列上。

WBOY
Release: 2016-06-07 15:33:07
Original
1312 people have browsed it

Oracle 中的复合索引谁放在第一列上。 考虑这个问题的依据 是 哪个列在前面时,进行索引访问的成本最低。 换句话说:这个需要了解b tree 索引的结构,数据库是怎么通过索引来检索数据,进行索引访问时的成本计算公式。 再换句话说: 复合索引哪一列放在前面

Oracle 中的复合索引谁放在第一列上。

考虑这个问题的依据 是 哪个列在前面时,进行索引访问的成本最低。
换句话说:这个需要了解b tree 索引的结构,数据库是怎么通过索引来检索数据,进行索引访问时的成本计算公式。

再换句话说:
复合索引哪一列放在前面,需要看查询sql中where条件 :比如 staff_id=12345 and created_time >=trunc(sysdate)
此时,要建立statff_id,created_time的 复合索引。也就是说,要结合查询语句中谓词(where条件)的写法。

以上来源于:oracle DBA 手记 数据库诊断案例与性能优化实践,第216-224页,熊军。


那么若是不考虑查询语句中谓词的写法呢?
此时可以参考 >,第86到87页。
在决定复合索引的哪一列的哪一列应该是前导列时,建议使用聚簇因子作为标准。

--不太理解这句话,先记录下来。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!