0
0
MySQLquery~5 mins

Why indexes speed up queries in MySQL - Quick Recap

Choose your learning style9 modes available
Recall & Review
beginner
What is an index in a database?
An index is like a shortcut or a map that helps the database find data quickly without looking at every row.
Click to reveal answer
beginner
How does an index speed up a query?
It reduces the amount of data the database scans by pointing directly to the rows that match the search, like using a book's index to find a topic fast.
Click to reveal answer
beginner
What happens if a table has no index and you search for a value?
The database checks every row one by one, which takes more time, especially if the table is large.
Click to reveal answer
intermediate
What is a common data structure used for indexes in MySQL?
MySQL often uses B-trees for indexes, which keep data sorted and allow fast searching, inserting, and deleting.
Click to reveal answer
intermediate
Can indexes slow down data insertion or updates? Why?
Yes, because the database must update the index every time data changes, which adds extra work.
Click to reveal answer
What does an index in a database help with?
AFinding data faster
BMaking data bigger
CDeleting data automatically
DBacking up data
If a table has no index, how does the database find data?
AIt scans every row one by one
BIt uses a shortcut
CIt guesses the location
DIt uses a cache
Which data structure is commonly used for indexes in MySQL?
ALinked list
BB-tree
CStack
DHash table
What is a downside of having many indexes on a table?
ADatabase crashes
BQueries become slower
CData gets lost
DData insertion and updates become slower
Why is using an index like using a book's index?
ABoth delete unnecessary pages
BBoth make the book heavier
CBoth help find information quickly without reading everything
DBoth print the whole content
Explain in simple terms why indexes make database queries faster.
Think about how a book index helps you find a topic quickly.
You got /3 concepts.
    Describe one tradeoff of using indexes in a database.
    Indexes speed up reading but can slow down writing.
    You got /2 concepts.