I have been in love with books and libraries most of my life.
I remember some of my earliest favorites: Little House on the Prairie, Anne of Green Gables, Bridge to Terebithia, The Chronicles of Narnia. I remember feeling grown up when my sixth grade teacher handed me Gone With the Wind.
I would read anytime and anywhere. While eating breakfast at the dining room table. Sitting on the swings. Walking through the halls at school. In the car on road trips. At dinner, much to my mother’s frustration. In bed, under the covers, with a flashlight. Books were my first love.
During summer vacations, my mom took me and my sisters to the library weekly. Even though I lived in a tiny town with a tiny library, this was my favorite day each week. I read entire series and genres. One summer I worked through all the Nancy Drew and Hardy Boys novels; another summer I read every Zane Grey and Louis L’Amour book I could get my hands on.
At the age of 12, I was asked to work in the school library, in place of a study hall. I kept the job for two years, and loved every moment of it. I had many tasks, from putting away returned books to checking people out. The fun of stamping the “return by date” cards remains in my memory to this day. (Ask me how this is related to Indiana Jones someday.)
Working in the library was my first introduction to indexes. Not just the index at the back of the book, either. There was the venerable and mysterious card catalog.
The words “Dewey Decimal system” still lead me to link numbers and subjects. 920’s are biographies, for example. (I remember reading George Armstrong Custer’s at least three times. I went through a biography phase.) Every book is assigned a number – a class and a section. Call numbers can be assigned. To find a book, you need to know some information about it – you need to traverse the index!
Think of the Dewey Decimal classification for a book being a clustered index. It’s unique for each book, and tells the librarian what order it should be placed in on the shelf. When looking for a specific book, you look it up in the card catalog, then walk to that area of the library – no wandering around, looking through piles of random books (like heaps!).
But what if I want to find all books by a specific author, or on a certain topic? The card catalog gives you cards organized by last name, and topic, which are like nonclustered indexes. If you were looking for a book written by me, you could flip through “B” to find “Borland”. My card would include the book title, topic, and the number. This is essentially a nonclustered index – it points to the clustered index, where I can find the book on the shelf.
Just like a library would be a mess and books would be almost impossible to find without the Dewey Decimal system, the information in your database is going to be much harder to find – and slower to return – without indexes.
Want to learn more about indexes? It’s one of our favorite topics here at Brent Ozar Unlimited! Visit our Index This page for more resources!