【索引】反向索引

简介:
1,Creating data
Reversed key indexes use b-tree structures, but preprocess key values before inserting them. Simplifying, b-trees place similar values on a single index block, e.g., storing 24538 on the same block as 24539. This makes them efficient both for looking up a specific value and for finding values within a range. However if the application inserts values in sequence, each insert must have access to the newest block in the index in order to add the new value. If many users attempt to insert at the same time, they all must write to that block and have to get in line, slowing down the application. This is particularly a problem in clustered databases, which may require the block to be copied from one computer's memory to another's to allow the next user to perform. their insert.

Reversing the key spreads similar new values across the entire index instead of concentrating them in any one leaf block. This means that 24538 appears on the same block as 14538 while 24539 goes to a different block, eliminating this cause of contention. (Since 14538 would have been created long before 24538, their inserts don't interfere with each other.)


2,Querying data
Reverse indexes are just as effective as for finding specific values, although they aren't helpful for range queries, which turn out to be uncommon for artificial values such as sequence numbers. When searching the index, the query processor simply reverses the search target before looking it up.

3,Deleting data
Another benefit impacts applications that delete data. Typically, applications delete data that is older on average (with lower values of the sequence) before deleting newer data. In standard b-trees, many index blocks end up containing few values, with a commensurate increase in unused space, referred to as "rot". Rot not only wastes space, but slows query speeds, because a smaller fraction of a rotten index's blocks fit in memory at any one time. In a b-tree, if 14538 gets deleted, its index space remains empty. In a reverse index, if 14538 goes before 24538 arrives, 24538 can reuse 14538's space.
相关文章
|
索引
【索引】反向索引
1,Creating dataReversed key indexes use b-tree structures, but preprocess key values before inserting them.
673 0
|
SQL 索引 关系型数据库
【索引】反向索引引起排序
    反向索引是B*Tree索引的一个分支,它的设计是为了运用在某些特定的环境下的。Oracle推出它的主要目的就是为了降低在并行服务器(Oracle Parallel Server)环境下索引叶块的争用。
577 0
|
SQL 索引
【索引】反向索引--条件 范围查询
---查看索引的类型SQL> col table_name for a10SQL> col index_name foa a10SQL> select table_name ,index_name ,index_type from user_indexes wh...
751 0
|
PHP 索引
【索引】反向索引--条件 范围查询(二)
当 where 条件中 含有 条件或者 not in 时 走INDEX FAST FULL SCAN 执行计划中的 限制条件 not in 转换为 PHP code:SQL> select object_id from t1 where object_id  1;53519 rows selected.
662 0
|
SQL 关系型数据库 MySQL
表索引——隐藏索引和删除索引
前言 MySQL 8开始支持隐藏索引。隐藏索引提供了更人性化的数据库操作。
|
搜索推荐 索引
理解正向索引
倒排索引也叫做反向索引(inverted单词也有反转的意思,只不过大家喜欢翻译成倒排索引)。 倒排索引在搜索引擎中经常用到,倒排索引也叫做反向索引。某天在想,为什么叫做倒排索引呢?倒过来的,反转过来的。
1066 0
|
8月前
|
SQL 关系型数据库 MySQL
MySQL数据库——索引(6)-索引使用(覆盖索引与回表查询,前缀索引,单列索引与联合索引 )、索引设计原则、索引总结
MySQL数据库——索引(6)-索引使用(覆盖索引与回表查询,前缀索引,单列索引与联合索引 )、索引设计原则、索引总结
208 1
|
存储 索引
为什么范围后索引会失效 存储引擎不能使用索引中范围条件右边的列
比如说有三个字段 a b c,建立复合索引a_b_c。此时叶子节点的数据排序后可能为
129 0
|
存储 SQL 关系型数据库
【名词解释与区分】聚集索引、非聚集索引、主键索引、唯一索引、普通索引、前缀索引、单列索引、组合索引、全文索引、覆盖索引
【名词解释与区分】聚集索引、非聚集索引、主键索引、唯一索引、普通索引、前缀索引、单列索引、组合索引、全文索引、覆盖索引
588 1
【名词解释与区分】聚集索引、非聚集索引、主键索引、唯一索引、普通索引、前缀索引、单列索引、组合索引、全文索引、覆盖索引
|
存储 SQL 缓存
B+树索引使用(9)分组、回表、覆盖索引(二十一)
B+树索引使用(9)分组、回表、覆盖索引(二十一)

热门文章

最新文章