Why Did Joining Readings Double the Inspection Total?

Trace a many-to-many multiplication, then summarise each event stream at the intended grain before combining it.

15 sections · 4 questions · 1 coding challenge

1 / 15

Correct Matching Can Still Change What a Row Means

BOTIE

Relational operations compose, so a result from one operation can become the input to another. That power also makes it necessary to track the meaning and multiplicity of intermediate rows. SQL’s join semantics emit matching pairs, including every permitted combination.

A database cannot infer that a later SUM was meant to count each inspection only once. Our repair explicitly produces asset-level summaries before joining them. This follows from the required report grain rather than a special rule about maintenance data.

Sources for this history