0

i want to know what exactly happens in behind scene when we apply indexes. how i am able to fetch faster results?

i tried referring the tutorials related to indexes but have got enough information from it?

any help would be welcome

thanks

  • Imagine if you needed to open a book to page 123. But there were no page numbers. Or the chapters of a history book were ordered chronologically, but you wanted to look up a particular person. Think of how the index in the back makes that easy. – Rick James Jan 18 '23 at 01:22

1 Answers1

-1

Your RDBMS applies a B-Tree data structure on that column/columns. column's data get sorted and the mid-value is chosen as a Root node, values less than the root node are arranged in the left subtree and values greater than the Root node get arranged in the right subtree, at higher levels data get stored in various fragments. So when you lookup for a value it finds the target using binary search. Indexes increase the size of the table, more indexes mean more in size.