zoukankan      html  css  js  c++  java
  • 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
查看全文
  • 相关阅读:
    极光推送的设备唯一性标识 RegistrationID
    排行榜算法设计实现比较 排序树 平衡二叉树
    UCloud首尔机房整体热迁移是这样炼成的
    from appium import webdriver 使用python爬虫,批量爬取抖音app视频(requests+Fiddler+appium)
    客户续费模型 逻辑回归 分类器 AdaBoost
    推举算法 AdaBoost 哥德尔奖 Godel Prize
    基于 redis 的分布式锁实现 Distributed locks with Redis debug 排查错误
    Django’s cache framework
    随机森林算法预测法官判决
    时间特征正弦化
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10710127.html
  • Copyright © 2011-2022 走看看