0
$\begingroup$

I read that indexing a database will improve its performance by assigning a number to each row to loop through. Even after indexing, to get the data at say row 1024, shouldn't the memory reader go through all the 1023 rows before reaching 1024? I appreciate your time to explain this. Thank you!

$\endgroup$
  • 1
    $\begingroup$ RAM stands for Random Access Memory, meaning that a byte at any address can be read in (roughly) the same time -- when you tell the CPU to read the byte at address 1 million, it just asks for that byte directly, it doesn't have to read the through the first 999,999 bytes. SSD works similarly; hard disk access times are more complicated but still far better than reading everything up to the desired point; tape works how you describe. $\endgroup$ – j_random_hacker Dec 15 '19 at 3:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.