暂无图片
ORACLE索引底层 是用的什么?
我来答
分享
不是小熊
2022-02-10
ORACLE索引底层 是用的什么?

ORACLE索引底层 是用的什么?

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
lscomeon

Indexes are optional structures associated with tables and clusters that allow SQL queries to execute more quickly against a table.

Just as the index in this manual helps you locate information faster than if there were no index, an Oracle Database index provides a faster access path to table data. You can use indexes without rewriting any queries. Your results are the same, but you see them more quickly.

Oracle Database provides several indexing schemes that provide complementary performance functionality. These are:

  • B-tree indexes: the default and the most common

  • B-tree cluster indexes: defined specifically for cluster

  • Hash cluster indexes: defined specifically for a hash cluster

  • Global and local indexes: relate to partitioned tables and indexes

  • Reverse key indexes: most useful for Oracle Real Application Clusters applications

  • Bitmap indexes: compact; work best for columns with a small set of values

  • Function-based indexes: contain the precomputed value of a function/expression

  • Domain indexes: specific to an application or cartridge.



Using a Different Index Type

There are several index types available, and each index has benefits for certain situations. The following list gives performance ideas associated with each index type.

B-Tree Indexes

These indexes are the standard index type, and they are excellent for primary key and highly-selective indexes. Used as concatenated indexes, the database can use B-tree indexes to retrieve data sorted by the index columns.

Bitmap Indexes

These indexes are suitable for columns that have a relatively low number of distinct values, where the benefit of adding a B-tree index is likely to be limited. These indexes are suitable for data warehousing applications where there is low DML activity and ad hoc filtering patterns. Combining bitmap indexes on columns allows efficient AND and OR operations with minimal I/O. Further, through compression techniques they can generate a large number of rowids with minimal I/Os. Bitmap indexes are particularly efficient in queries with COUNT(), because the query can be satisfied within the index.

Function-based Indexes

These indexes allow access through a B-tree on a value derived from a function on the base data. Function-based indexes have some limitations with regards to the use of nulls, and they require that you have the query optimizer enabled.

Function-based indexes are particularly useful when querying on composite columns to produce a derived result or to overcome limitations in the way data is stored in the database. An example is querying for line items in an order exceeding a certain value derived from (sales price - discount) x quantity, where these were columns in the table. Another example is to apply the UPPER function to the data to allow case-insensitive searches.

Partitioned Indexes

Partitioning a global index allows partition pruning to take place within an index access, which results in reduced I/Os. By definition of good range or list partitioning, fast index scans of the correct index partitions can result in very fast query times.

Reverse Key Indexes

These indexes are designed to eliminate index hot spots on insert applications. These indexes are excellent for insert performance, but they are limited because the database cannot use them for index range scans.

Finding the Cost of an Index

Building and maintaining an index structure can be expensive, and it can consume resources such as disk space, CPU, and I/O capacity. Designers must ensure that the benefits of any index outweigh the negatives of index maintenance.

Use this simple estimation guide for the cost of index maintenance: each index maintained by an INSERTDELETE, or UPDATE of the indexed keys requires about three times as much resource as the actual DML operation on the table. Thus, if you INSERT into a table with three indexes, then the insertion is approximately 10 times slower than an INSERT into a table with no indexes. For DML, and particularly for INSERT-heavy applications, the index design should be seriously reviewed, which might require a compromise between the query and INSERT performance.

暂无图片 评论
暂无图片 有用 1
打赏 0
暂无图片
回答交流
Markdown


请输入正文
提交
相关推荐
centos8上安装Oracle 12c rac,环境能装上吗?
回答 3
可以是可以,但个人不太建议这么干,Linux8直接装19c多好,生命周期长且完全适配。Linux8装12c,兼容性都不好说,而且今年过后12c都没有补丁了。
Oracle 19.8rman备份能恢复到19.3上吗?
回答 2
官方指导在不同版本的补丁之间是可以rman恢复的,恢复完之后1、alterdatabaseopenresetlogsdowngrade;2、执行补丁里面的uninstall/downgrade脚本不过
Windows 2008 R2安装Oracle11g补丁的问题
回答 3
很有可能是em没停,在cmd命令行执行emctlstopdbconsole试试。
Startup force到底是不是安全关闭
回答 4
已采纳
startupforce:做shutdownabort启动的时候需要做实例恢复,起不来要看具体问题,多数是数据文件坏了吧
我想系统的学习下oracle,啥路线好些
回答 2
已采纳
看这里Oracle入门到精通https://www.modb.pro/path/323
Oracle 11g搭建的DG,可以用数据泵在备库上导数据吗?
回答 4
数据泵不能直接在屋里备库上导数据,导数据时数据泵会创建和维护一个表,需要写入权限,一般物理备库是readonly状态。如果一定要使用逻辑备份,建议使用exp操作
Oracle 该如何准确的统计当前用户下所有表的大小?
回答 6
你是问一个表如果有包含lob,如何统计吗?SELECT(SELECTSUM(S.BYTES)–TheTableSegmentsizeFROMDBASEGMENTSSWHERES.OWNERUPPER(
Oracle数据库启动报错Ora-00600 kfrValAcd30
回答 1
已采纳
搜后面的错误代码ora600kfrvalacd30《异常掉电导致的ORA600[kfrValAcd30]故障处理》https://www.modb.pro/db/26884
oracle10g dataguard不同步
回答 2
如果logarchivedest2参数有问题,看一下是不是用的都是一个service。而且一主一备的情况下,备库logarchivedeststate2配置与否都不会影响日志接收,看一下alter日志
ORACLE中between and是包含两边边界的吗?
回答 2
已采纳
IDbetweenAandB类似于A<ID<B
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~