Lena leaned back. The plastic wheels of her chair squeaked. For a moment, she just stared at the Results pane: the exact same data the finance team needed for their Monday report, but delivered like a sigh instead of a scream.
She rewrote the main procedure to use the new function. Another F5 . This time, the query finished in 0.3 seconds instead of 47. She ran SET STATISTICS TIME ON in a separate tab, just to watch the numbers tumble. Logical reads dropped from 18,000 to 400. mssql management studio
Before closing SSMS, she opened the Activity Monitor one last time. The CPU graph, once a frantic seismograph during the report’s runtime, now lay flat and calm. All was well in the realm of the relational engine. Lena leaned back
"Execution Plan," she whispered to herself, right-clicking the query pane. The graphical plan appeared, a surreal flowchart of arrows and boxes. Somewhere in that labyrinth of nested loops and hash matches, a monster was hiding. A parallel scan costing 87% of the query. Ridiculous. She rewrote the main procedure to use the new function
The familiar dark theme of SSMS usually felt like a cockpit to her—a place of control. She could summon tables, bend indexes to her will, and craft joins like poetry. Tonight, however, the Object Explorer felt like a maze. Every green "Executing..." spinner was a tiny taunt.
She highlighted the offending block—a scalar-valued function inside a WHERE clause. Of course. She’d warned the team a year ago. Scalar functions were row-by-row agony. But Mark, the senior dev who had since left for a startup, had called it "elegant."
Lena cracked her knuckles. Elegance didn’t scale.