0
0
SQLquery~5 mins

When indexes help and when they hurt in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main benefit of using indexes in a database?
Indexes speed up data retrieval by allowing the database to find rows faster without scanning the entire table.
Click to reveal answer
beginner
When can indexes hurt database performance?
Indexes can slow down data modification operations like INSERT, UPDATE, and DELETE because the index must be updated too.
Click to reveal answer
intermediate
Why might having too many indexes be a problem?
Too many indexes increase storage space and slow down write operations, making the database less efficient overall.
Click to reveal answer
beginner
How do indexes help with query filtering conditions?
Indexes allow the database to quickly locate rows matching filter conditions without scanning every row, improving query speed.
Click to reveal answer
intermediate
When is it not useful to create an index on a column?
Creating an index on columns with very few unique values (low cardinality) often doesn't help because many rows share the same value.
Click to reveal answer
What operation is most negatively affected by indexes?
ACREATE
BSELECT
CJOIN
DINSERT
Which of these is a good reason to create an index?
ATo reduce storage space
BTo speed up queries filtering on a column
CTo speed up bulk data inserts
DTo avoid updating data
What happens if you create too many indexes on a table?
AWrite operations become slower
BStorage space decreases
CQueries become slower
DIndexes automatically merge
Which column is least suitable for indexing?
AA column with few unique values
BA foreign key column
CA primary key column
DA column with many unique values
How do indexes improve SELECT queries?
ABy scanning the entire table faster
BBy reducing the number of columns
CBy quickly locating rows matching conditions
DBy compressing data
Explain when indexes help improve database performance and when they can cause problems.
Think about read vs write operations and data uniqueness.
You got /4 concepts.
    Describe how indexes affect SELECT queries and INSERT operations differently.
    Consider the cost of maintaining indexes during data changes.
    You got /4 concepts.