Sample Header Ad - 728x90

How DB index works internally at high level?

0 votes
3 answers
147 views
I have around 500 GB of data in one table of MySQL which has around 5 billion records. It has around 15 columns. It has index on all the required columns. When I do select * from big_table where index_column = some_value it takes couple of minutes to return the data. I am not sure how indexing works internally here.Here is my understanding 1. DB vendor will bring indexed column complete(not just data in where clause) data in memory first 2. Find the values(in where clause) under data fetched in step_1 to get the record row location in actual table. 3. Then another IO call will go to disk to get all required data based on row location fetched in step_2 Is that correct ? I am not sure on first step i.e. whether complete data of indexed column is fetched in memory or values are searched on disk itself without bringing the complete data in memory ?
Asked by user3198603 (399 rep)
Mar 10, 2019, 02:07 AM
Last activity: Aug 3, 2025, 12:11 PM