Oracle中查看建立索引和使用索引的注意点

一、查看和建立索引
select * from user_indexes where table_name = ‘student‘
create index i_student_num on student(num)

二、使用索引的注意点 ①类型匹配 若student中num列是varchar类型。语句select * from student where num = 100 该语句被转化为select * from student where to_number(num) = 100。该列的索引就失效了。 ②避免索引列參与计算? 索引失效:select * from student where num * 10 > 10000? 索引有效:select * from student where num > 10000 / 10 ③不要对索引列使用IS NULL或IS NOT NULL 原则上对某一个列建立索引的时候,该列就不应该同意为空。 索引失效:select * from student where num is null

相关文章

Java Oracle 结果集是Java语言中处理数据库查询结果的一种方...
Java AES和Oracle AES是现代加密技术中最常使用的两种AES加密...
Java是一种广泛应用的编程语言,具备可靠性、安全性、跨平台...
随着移动互联网的发展,抽奖活动成为了营销活动中不可或缺的...
Java和Oracle都是在计算机领域应用非常广泛的技术,他们经常...
Java 是一门非常流行的编程语言,它可以运行于各种操作系统上...