Indexing Rules of Thumb & Index Selection Decisions

來源:互聯網
上載者:User

Indexing Rules of Thumb :

 

 

 

  1. Index every primary key and most foreign keys in the database.
  2. Attributes frequently referenced in SQL WHERE clauses are potentially
    good candidates for an index.
  3. Use a B+tree index for both
    equality and range queries.
  4. Choose carefully one clustered
    index for each table.
  5. Avoid or remove redundant
    indexes.
  6. Add indexes only when
    absolutely necessary.
  7. Add or delete index columns for
    composite indexes to improve performance.
    Do not alter primary key columns.
  8. Use attributes for indexes with
    caution when they are frequently updated.
  9. Keep up index maintenance on a
    regular basis; drop indexes only when
    they are clearly hurting performance.
  10. Avoid extremes in index cardinality and value distribution.
  11. Covering indexes (index only) are useful, but often overused.
  12. Use bitmap indexes for high-volume data, especially in data
    warehouses.

 Index Selection Decisions :

  1. Does this table require an index or not, and if so which search
    key should I build an index on?
  2. When do I need multi-attribute
    (composite) search keys, and
    which ones should I choose?
  3. Should I use
    a dense or sparse index?
  4. When can I use a covering
    index?
  5. Should I create a clustered
    index?
  6. Is an index still preferred
    when updates are taken into
    account? What are the tradeoffs between queries and updates for each index
    chosen?
  7. How do I know I made the right
    indexing choice?

 

-- <Physical Database Design >

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.