Indexing Rules of Thumb Index Selection Decisions

WBOY
풀어 주다: 2016-06-07 17:44:06
원래의
1073명이 탐색했습니다.

Indexing Rules of Thumb : Index every primary key and most foreign keys in the database. Attributes frequently referenced in SQL WHERE clauses are potentially good candidates for an index. Use a B+tree index for bothequality and range quer

Indexing Rules of Thumb :

 

 

 

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

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

    --

     

     

    ,网站空间,网站空间,香港空间
    관련 라벨:
    원천:php.cn
    본 웹사이트의 성명
    본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
    인기 튜토리얼
    더>
    최신 다운로드
    더>
    웹 효과
    웹사이트 소스 코드
    웹사이트 자료
    프론트엔드 템플릿