InterviewStack.io LogoInterviewStack.io

Query Optimization and Execution Plans Questions

Making queries fast: reading and interpreting execution/explain plans, identifying full scans, spotting SQL anti-patterns, and rewriting queries for better performance. Covers how the planner chooses join order and access methods, and how statistics drive those choices. A core skill for anyone responsible for query performance in production.

MediumTechnical
73 practiced

What is predicate pushdown, and why does it matter for query performance, especially against columnar storage formats (Parquet, ORC) or a foreign data wrapper? Give a concrete example where moving a filter earlier in a query (for example into a subquery or a join) lets the engine reduce how much data it reads, and describe how you would verify from the plan that pushdown is actually happening rather than assumed.

HardTechnical
76 practiced

A join between two tables produces more rows than expected because of an unanticipated many-to-many relationship, and it is inflating a downstream aggregate. How would you confirm that duplication (rather than a logic bug elsewhere) is the cause, and what are your options for fixing it without silently dropping data you actually need?

HardTechnical
95 practiced

Explain how a Bloom filter can be used during join planning in a distributed query engine to reduce data movement. Give a concrete scenario where building a Bloom filter on the smaller (build) side helps, and name a real drawback of relying on it.

That is every published Query Optimization and Execution Plans question for Machine Learning Engineer so far. Browse the other topics in this category, or practice this one interactively.