| Index Database |
Article Index for Index |
Website Links For Database |
Information AboutIndex Database |
| CATEGORIES ABOUT INDEX DATABASE | |
| data management | |
|
A Database index is a Data Structure that '''improves the''' '''speed of operations in a Table .''' Indexes can be created using one or more Columns , providing the basis for both rapid random lookups and efficient ordering of access to records. The disk space required to store the index is typically less than the storage of the table (since indexes usually contain only the key-fields according to which the table is to be arranged, and excludes all the other details in the table), yielding the possibility to store indexes into memory from tables that would not fit into it. In a Relational Database an index is a copy of part of a table. Some databases extend the power of indexing by allowing indexes to be created on functions or Expressions . For example, an index could be created on upper(last_name), which would only store the uppercase versions of the last_name field in the index. Another option sometimes supported is the use of "filtered" indexes, where index entries are created only for those records that satisfy some conditional expression. A further aspect of flexibility is to permit indexing on User-defined Functions , as well as expressions formed from an assortment of built-in functions. All of these indexing refinements are supported in Visual FoxPro , for example.1Indexes may be defined as unique or non-unique. A unique index acts as a constraint on the table by preventing identical rows in the index and thus, the original columns. ARCHITECTURE Index architectures are classified as clustered or non-clustered. Clustered indexes are indexes that are built based on the same key by which the data is ordered on disk. In some relational database management systems such as Microsoft SQL Server , the Leaf Node of the clustered index corresponds to the actual data, not simply a pointer to data that resides elsewhere, as is the case with a non-clustered index. Due to the fact that the clustered index corresponds (at the leaf level) to the actual data, the data in the table is sorted as per the index, and therefore, only one clustered index can exist in a given table (whereas many non-clustered indexes can exist, limited only by the particular RDBMS vendor). Unclustered indexes are indexes that are built on any column. Each relation can have a single clustered index and many unclustered indexes. Clustered indexes usually store the actual records within the data structure and as a result can be much faster than unclustered indexes 2. Unclustered indexes are forced to store only record IDs in the data structure and require at least one additional I/O operation to retrieve the actual record. 'Intrinsic' might be a better adjective than 'clustered' -- indicating that the index is an integral part of the data structure storing the table. Indexes can be implemented using a variety of data structures. Popular indices include Balanced Tree s, B+ Tree s and Hashes .3 COLUMN ORDER The order in which columns are listed in the index definition is important. It is possible to retrieve a set of row identifiers using only the first indexed column. However, it is not possible or efficient (on most databases) to retrieve the set of row identifiers using only the second or greater indexed column. For example, imagine a phone book that is organized by city first, then by last name, and then by first name. If given the city, you can easily extract the list of all phone numbers for that city. However, in this phone book it would be very tedious to find all the phone numbers for a given last name. You would have to look within each city's section for the entries with that last name. Some databases can do this, others just won’t use the index. APPLICATIONS AND LIMITATIONS Indexes are useful for many applications but come with some limitations. Consider the following data structure until the Finkelstein entry has been found; this is much less computationally expensive than a full table scan. Consider this SQL statement: SELECT email_address FROM customers WHERE email_address LIKE '%@yahoo.com';. This query would yield an email address for every customer whose email address ends with "@yahoo.com", but even if the email_address column has been indexed the database still must perform a full table scan. This is because the index is built with the assumption that words go from left to right. With a Wildcard at the beginning of the search-term the database software is unable to use the underlying b-tree data structure. This problem can be solved through the addition of another index created on reverse(email_address) and a SQL query like this: SELECT email_address FROM customers WHERE reverse(email_address) LIKE reverse('%@yahoo.com');. This puts the wild-card at the right most part of the query (now moc.oohay@%) which the index on reverse(email_address) can satisfy.TYPES Bitmap index See Also: Bitmap index A bitmap index is a special kind of index that stores the bulk of its data as bitmaps and answers most queries by performing bitwise logical operations on these bitmaps. The most commonly used index, such as B+trees, are most effective if the values it indexes do not repeat or repeat a relatively smaller number of times. In contrast, the bitmap index is designed for cases where the values of a variable repeats very frequently. For example, the gender field in a customer database usually contains two distinct values, male or female. For such variables, the bitmap index can have a significant performance advantage over the commonly used trees. Dense index A dense index in Database s is a File with pairs of keys and Pointer s for every Record in the data file. Every key in this file is associated with a particular pointer to ''a record'' in the sorted data file. In clustered indexes with duplicate keys the dense index points ''to the first record'' with that key.Database Systems: The Complete Book. Hector Garcia-Molina, Jeffrey D. Ullman, Jennifer D. Widom Sparse index A sparse index in databases is a file with pairs of keys and pointers for every record in the data file. Every key in this file is associated with a particular pointer ''to the block'' in the sorted data file. In clustered indexes with duplicate keys the sparse index points ''to the lowest search key'' in each block.Sparse index plays important role in databases. SEE ALSO Please add coverage of Hashing in Link Lists REFERENCES |
|
|