Generating some medical documents from binary code, with headers to boot, the data set is large enough to warrant optimizing my #SQL to run faster, throwing around some syntax, trying a few tricks, and compare results... A #CTE is often the fastest ticket to #turbocharge a query, especially when there's complex joins to be navigated. It requires re-thinking the problem and a little more coding than just flipping a JOIN or IN/EXISTS clause (which often speed things up too), however.