My question all is in the title. Why really an index makes a query so fast?! I've read some articles about indexes and how to use them. But still I don't know what happens in the background when I create an index on a column?
Will it sort the rows? Ok so? You know, the speed of one of my queries decreased from 4 sec
to 0.04 sec
when I created a composite index on two columns.
Anyway I'm so interested in understanding what happens when I create an index? How they help to the performance?