Database Index - Column Order

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 you are 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.

Read more about this topic:  Database Index

Famous quotes containing the words column and/or order:

    The actor who lets the dust accumulate on his Ibsen, his Shakspere [sic], and his Bible, but pores greedily over every little column of theatrical news, is a lost soul.
    Minnie Maddern Fiske (1865–1932)

    All things being equal, I would choose a woman over a man in order to even the balance of power, to insinuate a different perspective into the process, to give young women something to shoot for and someone to look up to. But all things are rarely equal.
    Anna Quindlen (b. 1952)