NOTE: If data modification
performance is poor, you may have too many indexes. While indexes favor “select
operations”, they slow down “data modifications”.
ABOUT INDEXES
Indexes
are the most important physical design element in improving database
performance:
•
Indexes help prevent table scans. Instead of reading hundreds of data pages, a
few index pages and data pages can satisfy many queries.
•
For some queries, data can be retrieved from a nonclustered index without ever
accessing the data rows.
•
Clustered indexes can randomize data inserts, avoiding insert “hot spots” on
the last page of a table.
•
Indexes can help avoid sorts, if the index order matches the order of columns
in an order by clause.
In addition to their performance benefits, indexes can
enforce the uniqueness of data.
Indexes
are database objects that can be created for a table to speed direct access to
specific data rows. Indexes store the values of the key(s) that were named when
the index was created, and logical pointers to the data pages or to other index
pages.
Adaptive
Server (SYBASE) provides two types of indexes:
•
Clustered indexes, where the table data is physically stored in the order of
the keys on the index:
•
For allpages-locked tables, rows are stored in key order on pages, and pages
are linked in key order.
•
Nonclustered indexes, where the storage order of data in the table is not
related to index keys.
You can create only one clustered index on a table
because there is only one possible physical ordering of the data rows.
You can
create up to 249 nonclustered indexes per table. A table that has no clustered
index is called a “heap”.
Comments
Post a Comment