skip to content

A job's plan shows few points where records cross the network and even widths, yet the run takes hours — what can the printed text not tell you?

level: seniorimportance: should knowfreq 43%

answer

  1. shape, never quantity
  2. widths count pieces, not records
  3. instruction to the read, not its effect
  4. evenness is the usual culprit
  5. measure the run, then re-read

basics

~20 s

Everything about volume and evenness. The printed text states the shape the engine intends to run: how many records flow along each edge, how unevenly they land across pieces, how much a crossing moves and how long anything takes are all measurements it does not contain.

solid answer

~50 s

A printed plan is a statement of **intent and shape**, not a measurement. It can show the points where records must be sent between workers, how the listing breaks into runs between them, each step's width and what the read was instructed to produce — and none of those is a quantity of data. What it omits is exactly what makes a well-shaped job slow: how many records actually flow along each edge, how unevenly they are spread so that one piece holds most of them, how many bytes a crossing genuinely moves, whether a step spilled part of its working set to local disk, what a per-record body costs, and whether one worker was simply slow. Note also that the read's column list and pushed condition record what the read was *told*; how much it truly skipped depends on the source. Those answers come from measuring the run, not from re-reading the text.

go deeper

for a junior

Remember that the printed text describes the shape of the work, not how much data there is. No line in it carries a duration, a record count that was observed, or a number of bytes moved.

for a middle

List what is absent and why: volumes along each edge, evenness across pieces, bytes moved at a crossing, spill, and per-record cost. Explain that a width counts pieces rather than records.

for a senior

Show the order of work: use the plan as a map for where to measure, get per-piece numbers, separate an uneven data distribution from a slow machine, and treat re-planning the shape as the last hypothesis rather than the first.

for a principal

Decide what a platform should capture by default so this gap is closed for every job, rather than leaving each engineer to rediscover that shape and volume are different things.

## Shape against quantity Everything a printed plan contains is a statement about **shape**: which steps exist, which needs records from other workers, how the listing divides into runs between those points, how many pieces each step handles at once, and what instruction was handed down to the read. Not one of those is a quantity of data. A job can have a plan you would happily defend in review and still run for hours, and when it does, nothing further can be extracted from the text — you have to go and measure. This matters in an interview because the candidate who cannot say where reading stops will keep re-reading the plan, look for cleverer rewrites, and never reach the thing that was actually wrong. ## What is absent, item by item - **Row counts along each edge.** The plan says a step exists, not how many records reach it. A condition that you assumed removed most of the input may be removing almost none. - **Evenness.** Widths count pieces, never records. Two thousand pieces read the same in the text whether they are equal or whether one holds most of the data — *skew*, where one piece is far heavier than the rest. This is the most common reason a good-looking plan runs badly. - **Bytes moved.** A crossing's presence is printed; its volume is not. One crossing moving a few megabytes and one moving several terabytes look identical. - **Spill.** Whether a step ran out of room and wrote part of its working set to local disk is a run-time event; nothing about the shape predicts it. - **Per-record cost.** A step whose body is ordinary code the rewriter cannot look inside appears as one line. Whether that line costs a microsecond or a network call per record is invisible. - **Duration and pacing.** No step in the printed text carries a time. Nor does the text say how many pieces were queued behind the ones running. - **A slow machine.** One worker running slowly for reasons of its own — a *straggler* — is a property of the cluster that day, and the plan describes no machines at all. ## The read's instruction is not the read's effect This is the subtle one, and it is worth saying explicitly because it looks like an exception. The plan *does* show what the read was told: which columns to produce, and which conditions were pushed down to the point of reading so rejected rows are never produced at all. But that is an instruction. How much is genuinely avoided depends on the source: - a layout that stores columns separately can skip the unrequested ones outright, while a row-oriented or opaque source may have to read and decode the record anyway; - a condition on the attribute the data is physically arranged by can eliminate whole files or whole directories, while the same condition on any other attribute eliminates nothing before decoding; - a source that exposes no filtering interface at all accepts the instruction and returns everything. So "the filter was pushed to the read" is a true reading of the text and a false conclusion about volume. What was skipped is a measurement. ## Where the missing answers actually live | Question | Where it is answered | |---|---| | How many records flowed, how long a step took | Measurements collected while the job ran | | Whether one piece held most of the data | The spread of work across pieces, diagnosed from run measurements | | Whether the run cost is worth changing | Costing a movement, a separate subject with its own rules | | Whether one machine was to blame rather than the data | The slow-worker case, distinguished by whether the same piece is slow on a re-run | One related caution about the text itself: where an engine prints predicted row counts at all, they are predictions made before anything ran. Reading predictions against what really happened is a general execution-plan skill that belongs with database query plans, and it is not a substitute for measuring a distributed job. ## What a senior actually does next 1. **Keep the plan as the map.** It tells you where to point the measurement: at the edges into and out of each crossing, and at the widest steps. 2. **Get per-piece numbers for one step**, and look at the distribution rather than the total. A mean tells you nothing here; the maximum against the median is the whole finding. 3. **Separate data from machine.** If the same piece is slow on a re-run, the data caused it; if a different one is slow each time, the cluster did. 4. **Only then reconsider shape.** If the volumes are as expected and evenly spread and it is still slow, the plan may genuinely be the problem — but that is the last hypothesis, not the first. The short version to say out loud: the printed plan is a route map, and a route map cannot tell you how much traffic is on each road.

  • The plan shows a condition pushed to the read, yet the job still reads nearly everything. How is that consistent?
    The plan records the instruction, not its effect. If the condition is on an attribute the data is not physically arranged by, nothing can be eliminated before records are decoded; some sources expose no filtering interface at all and simply return everything. The push-down is real and the saving is zero.
  • Given even widths and a slow job, how do you tell an uneven data distribution from a slow machine?
    Look at whether the same piece is slow across re-runs. If one particular piece is consistently the last to finish, the data is uneven; if a different piece is slow each time and the slow ones share a machine, the cluster caused it. The plan cannot distinguish them because it describes no machines.
  • If the text carries predicted row counts, can you use them instead of measuring?
    Only as a hint about what the engine believed. They are predictions made before anything ran, and comparing predictions against reality is a general execution-plan skill rather than a distributed one. For a job that is already slow, the per-piece measurements from the run are the evidence.

A printed plan is a route map, not a traffic report. It shows every junction where you must change roads and how many lanes each road has, but it says nothing about how many cars are on them — so a short route with two junctions can still take all afternoon, and no amount of re-reading the map will show you why.

saying these in an interview costs you the question

  • Treats a pushed-down condition as proof little data was read
  • Reads even widths as proof the work is evenly spread
  • Looks for a better plan before measuring the run
  • Assumes the plan reveals which machine was slow
  • Thinks predicted counts in the text are observations
  • Believes a crossing's volume can be read from the listing