![]() ![]() Indexes allow us to create sorted lists without having to create all new sorted tables, which would take up a lot of storage space. This took 3 comparisons to find the right answer instead of 8 in the unindexed data. We could then half the remaining rows and make the same comparison. ![]() If we wanted to search for “Zack” and we know the data is in alphabetical order we could jump down to halfway through the data to see if Zack comes before or after that row. If the table was ordered alphabetically, searching for a name could happen a lot faster because we could skip looking for the data in certain rows. Visualization for finding the last entry: If the data you are looking for is towards the very end, this query would take a long time to run. To get this information out of the database the computer will look through every row until it finds it. Imagine you want to find a piece of information that is within a large database. Indexing makes columns faster to query by creating pointers to where data is stored within a database. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |