Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Pennsylvania Department of Public Welfare Office of Information Systems Indexes Version 1.1 September 20, 2002 DPW Business and Technical Standards Revised 09/20/02 Table of Contents Introduction ............................................................................................................................... 3 Purpose ..................................................................................................................................... 3 Document Change Log ............................................................................................................. 3 Deciding What Elements to Index in a Table........................................................................... 4 Naming Indexes ........................................................................................................................ 4 Deciding on an Indexing Method ............................................................................................. 4 Referencing Indexes in an Index Tablespace ......................................................................... 5 769864849 Page 2 of 5 DPW Business and Technical Standards Revised 09/20/02 Indexes Introduction In relational databases, indexing reduces data search time greatly. Indexing entails choosing what table elements to index, choosing an indexing method, naming indexes, and knowing where to view indexes for reference. Purpose The purpose of this document is to provide information and standards regarding relational database indexing. Document Change Log Change Date Version CR # Change Description Author and Organization 05/09/01 1.0 N/A Initial creation Deloitte Consulting 09/20/02 1.1 00CT Edited for style Beverly Shultz Diverse Technologies Corporation / Deloitte Consulting 769864849 Page 3 of 5 DPW Business and Technical Standards Revised 09/20/02 Deciding What Elements to Index in a Table During the development phase, the application developer and database administrator (DBA) consider what elements within the tables are frequently referenced in application code. Although the majority of columns referenced in Structured Query Language (SQL) WHERE clauses may be found in the primary keys of tables, which have inherent indexes, additional columns may be referenced enough to consider the creation of an index to enhance performance. Naming Indexes Indexes should be named based on their physical type (clustered or non-clustered) and associated table. Following are examples: Index Type Name Format Example Clustered Index CDX_Table Name_(Optional description) CDX_T_APPLN_APPLN_ID Non-clustered Index NDX_Table Name_(Optional description) NDX_T_INDIV_SSN Deciding on an Indexing Method There are various types of indexes employed in relational databases, including B-tree and bitmap indexes. Use B-tree indexes on columns that are found in large tables, will frequently appear in WHERE clauses in code, and have a large variety of values. When creating a B-Tree index that is composed of more than one column, the column with the most variety of data value or the column whose value is most frequently supplied in the WHERE clause is the first node of the index. Use bitmap indexes on columns that have a low variety of values. An example would be an Indicator column whose values can only by “Y” or “N,” and so on. Do not create bitmap indexes on a column that is frequently has new values added to it. 769864849 Page 4 of 5 DPW Business and Technical Standards Revised 09/20/02 Referencing Indexes in an Index Tablespace All indexes, primary keys, and foreign keys physically reside in an index tablespace. Index Type Bitmap Index 769864849 Name Format BMX_Table Name_(Optional description) Example BMX_T_APPLN_APPLN_ID Page 5 of 5