0
0
HLDsystem_design~5 mins

Database indexing in HLD - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a database index?
A database index is a data structure that helps speed up data retrieval by allowing the database to find rows faster without scanning the entire table.
Click to reveal answer
beginner
How does an index improve query performance?
An index works like a book's index: it points to the location of data, so the database can jump directly to the needed rows instead of checking every row.
Click to reveal answer
intermediate
What are the common types of database indexes?
Common types include B-tree indexes for range queries, hash indexes for exact matches, and bitmap indexes for columns with few unique values.
Click to reveal answer
intermediate
What is a trade-off when using indexes?
Indexes speed up reads but slow down writes because the index must be updated whenever data changes, and they also use extra storage space.
Click to reveal answer
intermediate
What is a composite index?
A composite index is an index on multiple columns, which helps queries that filter or sort by more than one column efficiently.
Click to reveal answer
Which data structure is commonly used for database indexes to support range queries?
AB-tree
BHash table
CLinked list
DStack
What is a downside of adding many indexes to a database table?
ALoss of data integrity
BSlower data retrieval
CReduced query flexibility
DIncreased storage and slower writes
Which type of index is best for exact match queries?
AHash index
BB-tree index
CBitmap index
DFull-text index
What does a composite index index?
AA single column
BMultiple columns
COnly primary keys
DOnly foreign keys
Why might a database choose not to use an index for a query?
AThe query is very complex
BThe index is corrupted
CThe table is very small
DThe database is offline
Explain how database indexes improve query speed and what trade-offs they introduce.
Think about how a book index helps find pages faster but takes space.
You got /4 concepts.
    Describe different types of database indexes and when to use each.
    Consider the kind of queries and data uniqueness.
    You got /3 concepts.