Loading section...
O(n²) -- Quadratic Time
Quadratic time is the pipeline killer. An O(n²) algorithm does work that grows with the square of the input size. If processing a thousand rows takes one second, ten thousand rows takes one hundred seconds, and one hundred thousand rows takes nearly three hours. Quadratic algorithms are the most common cause of real-world pipeline performance disasters, and they almost always come from the same pattern: doing an O(n) operation inside an O(n) loop. Why it matters: a nested loop join re-scans the inner table for every row in the outer table. Three orders against four customers means twelve comparisons. Double either side and the total quadruples. The Nested Loop Trap When n doubles, comparisons roughly quadruple. At n=100,000, this approach would need nearly 5 billion comparisons. The fix is