Relational Database Index Design and the Optimizers
1. Focus on the maor issues
It is vital to focus on the few really major issues,
not on the relatively unimportant detail under which many people drown. This is
key—to focus on a very few, crucially important areas—and to be able to say
how long it would take or how much it would cost.
2. The size of the table pages sets an upper limit to the length of table rows. Normally, a table row must fit in one table page; an index row must fit in one leaf page. If the average length of the rows in a table is more than one third of the page size, space utilization suffers. Only one row with 2100 bytes fits in a 4K page, for instance. The problem of unusable space is more pronounced with indexes. As new index rows must be placed in a leaf page according to the index key value, the leaf pages of many indexes should have free space for a few index rows, after load and reorganization. Therefore, index rows that are longer than 20% of the leaf page may result in poor space utilization and frequent leaf page splits.
It is vital to focus on the few really major issues,
not on the relatively unimportant detail under which many people drown. This is
key—to focus on a very few, crucially important areas—and to be able to say
how long it would take or how much it would cost.
2. The size of the table pages sets an upper limit to the length of table rows. Normally, a table row must fit in one table page; an index row must fit in one leaf page. If the average length of the rows in a table is more than one third of the page size, space utilization suffers. Only one row with 2100 bytes fits in a 4K page, for instance. The problem of unusable space is more pronounced with indexes. As new index rows must be placed in a leaf page according to the index key value, the leaf pages of many indexes should have free space for a few index rows, after load and reorganization. Therefore, index rows that are longer than 20% of the leaf page may result in poor space utilization and frequent leaf page splits.
3. Bitmap indexes consist of a bitmap (bit vector) for each distinct column value. Each bitmap has one bit for every row in the table. The bit is on if the related row has the value represented by the bitmap.
Bitmap indexes make it feasible to perform. queries with complex and unpredictable compound predicates against a large table. This is because ANDing and ORing bitmap indexes is very fast, even when there are hundreds of millions of table rows. The corresponding operation with B-tree indexes requires collecting a large number of pointers and sorting large pointer sets.
On the other hand a B-tree index, containing the appropriate columns, eliminates table access. This is important because random I/Os to a large table are very slow(about 10ms). With a bitmap index, the table rows must be accessed unless the SELECT list contains only COUNTs. Therefore, the total execution time using a bitmap index may be much longer than with a tailored, (fat) B-tree index.
Bitmap indexes should be used when the following conditions are true:
1. The number of possible predicate combinations is so large that designing adequate B-tree indexes is not feasible.
2. The simple predicates have a high filter factor, but the compound predicate(WHERE clause) has a low filter factor - or the SELECT list contains COUNTs only.
3. The updates are batched(no lock contention).
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-760171/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Database Testing: How to Regression Test a Relational DatabaseDatabase
- Relationship Database DesignDatabase
- 雲關係型資料庫(Relational Database Service,RDS)資料庫Database
- Tasks of a Database Administrator : Implement the Database Design (13)Database
- Systematic index design consists of two processesIndex
- Objectives of the Relational ModelObject
- 《Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases》論文總結IDECloudDatabase
- A Brief Introduce of Database Index(索引簡介)DatabaseIndex索引
- Design and implementation of database anomaly monitoring system based on AI algorithmDatabaseAIGo
- JBOSS + Mysql + CMP2.0 + RelationalMySql
- Hibernate in Action: Practical Object/Relational MappingObjectAPP
- KEEP INDEX | DROP INDEXIndex
- 從 Cloud-Native Relational DB 看資料庫設計Cloud資料庫
- rowid,index,INDEX FULL SCAN,INDEX FAST FULL SCAN|IndexAST
- Oracle資料庫Table,Index,Database分析統計資料方式總結及注意點(zt)Oracle資料庫IndexDatabase
- INDEX UNIQUE SCAN,INDEX FULL SCAN和INDEX FAST FULL SCANIndexAST
- Design Systems 02 - 什麼是 Design Principles
- Clustered Index Scan and Clustered Index SeekIndex
- Material DesignMaterial Design
- design for failureAI
- oracle hint之full,index,index_asc,index_desc,index_combile示例OracleIndex
- IndexIndex
- Index的掃描方式:index full scan/index fast full scanIndexAST
- rebuild index 和 recreate index (重新建立index) 的區別RebuildIndex
- pk 、unique index 和 index 區別Index
- global index & local index的區別Index
- alter index rebuild與index_statsIndexRebuild
- 論文翻譯:Extracting Relational Facts by an End-to-End Neural Model with Copy Mechanism
- Ant Design 官方《Ant Design 實戰教程》釋出
- standby database to primary database.Database
- B-index、bitmap-index、text-index使用場景詳解Index
- Index Full Scan vs Index Fast Full ScanIndexAST
- Using index condition Using indexIndex
- 【Oracle】global index & local index的區別OracleIndex
- Index Full Scans和Index Fast Full ScansIndexAST
- What is meant by Primary Index and Secondary IndexIndex
- Index Full Scan 與 Index Fast Full ScanIndexAST
- Ant Design VueVue