QuestionQ11

Performance Optimization, Querying & Transformation

A user is investigating a query that runs slowly by using Query Profile. The profile shows a join operator that consumes 10,000 records from the left table and 5,000 records from the right table, yet outputs 50,000,000 records. The join operator consumes 95% of total query execution time.

What is causing this performance problem, and how should it be resolved?

Explanation

An output of 50,000,000 rows is exactly the Cartesian-product count of 10,000 left rows multiplied by 5,000 right rows. This is an exploding join, which occurs when a join condition is missing or allows excessively broad many-to-many matching. The join predicates must be verified and made correct and sufficiently selective.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!