span_0“What is the primary bottleneck query optimization tries to reduce?”
I/O Cost (Input/Output). Disk access does not improve as fast as CPU speed (Moore’s Law), so minimizing block reads is the main goal.span_0
What are the three main resources that affect query response time?
What is a ‘Trivial Plan’ in SQL Server?
What happens if no Trivial Plan is found? (List the 3 Phases)
Difference between Logical and Physical Execution Plans?
What is the ‘Push Selection Down’ rule in refactoring?
What is the Relational Algebra rule for splitting a selection?
Nested Loop Join: How does it work and what is the I/O Cost?
Hash Join: How does it work and what is the I/O Cost?
Sort Merge Join: How does it work and what is the I/O Cost?
Concept: read both tables into memory , sort based on join columns with index
Cost: O(Num_Block_1 + Num_Block_2).
Use Case: Excellent if tables are already sorted or small.span_10
What is a Table Scan?
What is a Clustered Index?
The data blocks are ordered by the index , preferred over table scan
What is a Non-Clustered Index?
What is a ‘Cover Index’ (Index with Included Columns)?
What is an ‘Index Seek’?
span_17“Why should you avoid functions in a WHERE clause (e.g.
WHERE YEAR(date) = 2020)?”
span_18“Why is ‘SELECT *’ considered bad practice?”
It retrieves unnecessary columns, increasing I/O and preventing the use of Cover Indexes.span_18
How does MongoDB optimization differ from SQL Server?
How does MongoDB choose a winning plan?
What is a Compound Index in MongoDB?
What does ‘SARGable’ mean?
Search ARGument ABLE. A query written in a way that can take advantage of indexes (e.g., avoiding leading wildcards like ‘%John’).
In Relational Algebra, when can you distribute a Selection over a Join?