Reading an Execution Plan and Actual Row Counts
Locate an estimation error at the operator that introduced it and distinguish per-loop measurements from total work.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Read child operators as the inputs to their parent
An execution plan can report that a scan feeds a join, which feeds an aggregate. Compare estimated and actual cardinality starting near inputs. For a filter estimating 20 rows but passing 2000, later join errors can simply reflect that first underestimate. Examine access predicates, filters and relevant statistics before changing the join method. Observed times can include work on input subplans.
Repeated operators require the loop count
If a nested loop runs an inner scan 500 times and reports an average of three rows per execution, that inner work represents about 1500 returned rows across loops. Read the exact reporting conventions for the engine. Runtime inspection should use an intended read-only example when execution would otherwise make changes. Nested loops provide the repetition model. Selectivity estimation explains why a large error can start at a simple predicate.[1][2]