![]() That is, a key may be logically associated with a list of pointers to rows rather than a single pointer.įigure 1 illustrates how to reach the corresponding table row when an index record is located however, it does not explain why an index row can be found much faster than a table row. If this column is indexed, the index must contain pointers to all rows containing this value of an index key. However, some columns, like the column city in the airport table, can have the same value in multiple rows. The example in Figure 1 has airport code as its value hence, this index supports search by airport code.įor this particular index, all values in the airport_code column are unique, so each index entry point to exactly one row in the table. ![]() The value of an index key usually is equal to the value of a table attribute. Each row of the index consists of an index key and a pointer to a table row. The right part of Figure 1 shows a table, and the left represents an index that can be viewed as a special kind of a table. Such filtering conditions specify certain restrictions on table attributes.įigure 1 shows how an index can speed up the access to the specific table rows. Although index structures can differ significantly among index types, the speed-up is achieved due to a fast check of some filtering conditions specified in a query. That is, any query produces the same results with or without an index.įinally, an index is created with the hope (or confidence) that it improves performance of a specific query or (even better!) several queries. Invisibility means that a user cannot detect if an index is present or absent when writing a query other than the time the query takes to process. Full instructions are in the appendix of this article to create the database you will need if you wish to follow along with the examples.) Redundancy means that an index can be dropped without any data loss and can be reconstructed from data stored in tables (the postgres_air database dump we will use with the examples comes without indexes, but you can build them after you restore the database. Let’s discuss each of the bullet points in more detail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |