oracle索引
来源:互联网 发布:在线数据挖掘平台 编辑:程序博客网 时间:2024/06/06 09:40
建索引 的最佳条件:
在大表上建立索引
在where字句和相等条件经常用到的列建索引
客户表 name 字段建索引
索引的层次不能超过四层
索引缺点
1.建立索引,系统要占用大约为表的1.2倍的硬盘和内存来保存索引
2.更新数据的时候,系统必须要有额外的时间来更新索引,维持数据和索引的一致性
在以下字段建索引就很蠢
1.很少或者从来不引用的字段
2.逻辑性字段 如sex 非常容易查询的字段
按照数据存储方式,分为B*树索引,反向索引,位图索引;
按列来分 单列索引,复合索引;
按照索引的唯一性分为 唯一索引和非唯一索引
还有函数索引,全局索引,分区索引,
B*树索引建立在重复值很少的列上
位图索引建立在重复值很多的列上不同值相对固定的列上
单列索引
create index 索引名 on 表名(列)create index nameindex on customer(name)
复合索引
按照客户的姓名和电话查询
create index nameindex on customer(name,tel)
查询表上所用的索引 查看数据字典视图dba_indexes 和user_indexes
select index_name,index_type from user_indexes where table_name='表名';
显示索引列 数据字段视图user_ind_columns 显示索引相对列的信息
select table_name,column_name from user_ind_columns where index_name='索引名';
删除索引
drop index 索引名称;
0 0
- oracle索引-函数索引
- oracle索引
- oracle 索引
- oracle 索引
- oracle索引
- oracle索引
- oracle索引
- oracle索引
- oracle 索引
- Oracle 索引
- oracle索引
- Oracle 索引
- Oracle 索引
- Oracle 索引
- Oracle索引
- oracle 索引
- oracle 索引
- Oracle索引
- [Qt5] 减少dll依赖和大小(特别是webkit的大小和依赖) - 一 水
- 【C语言】LeetCode 3. Longest Substring Without Repeating Characters
- spring自定义标签如何实现
- spring通过注解配置
- PostgreSQL学习篇9.17 数组类型
- oracle索引
- js简单的验证码测试
- ‘8 reasons I accepted your article'
- 友盟推送的详细过程
- Linux 定时任务crontab
- 采用devtools实现热部署
- android IBeacon 开发(上)搜索IBeacon基站
- 支付宝 支付集成 报错(一)
- sparkline 图标插件(Bootstrap)