Skip to content

re: Explain indexing in databases Like I'm Five VIEW POST


I’m looking for a number in the phone book where the last name starts with G. Instead of turning every page starting with A to G, I open the phonebook in the middle, then I cut that in half, and half that again till I get to the record I am searching for. That’s essentially what indexes do in a DB.


Haha ‘half’ might have been a bad word to use, rather the emphasis should be on removing a subset of the data to eliminate potential possibilities. It’s easier to find a needle in a haystack if you know which section of the hay it isn’t in.

code of conduct - report abuse