There’s beauty everywhere – even in SQL Server. I was just staring at this plan when I was struck by its beauty:
Oh, sure, it’s ugly, and I recoiled in horror at first, but when you get over that reaction, there’s an amazing amount of stuff there. Someone – probably many someones – poured every waking moment of their life into building a query that does a staggering amount of stuff. Then under that, SQL Server had to churn away to interpret all that text, look at the database, and decide how to execute this work. All of that isn’t just man-hour – it’s man-decades, all distilled into one giant array of elbow lines. One screen doesn’t even begin to capture it. Let’s look at another view of that same plan:
It’s like a Mark Bradford piece, one of his giant collage mashups of aerial maps – you just can’t appreciate it until you see the plan in life size, scrolling around in all its sprawl. Once I saw execution plans as art, I went looking for pleasing patterns, and they were everywhere.
Repeated rows of parallel parallelism become little armies marching in formation. Who cares if the work looks redundant? Why tune the query? Praise the developer for their artful design.
Lines of loops become fishermen casting their lines into the bottom of the execution plan, dragging up data from the deep. The execution plan turns into a statement about religion: these fishers of data work diligently, raising up information to the highest power – the end user.
Familiar enemies come to life as villains, bringing conflict to the art. Curses, cursors!
Everyone wants a fresh start. The artist tells of wiping the slate clean before starting anew, but thanks to the foreshadowing lines to the left, we all know how this will end – badly. The strife begins again with each call of the query, struggling against itself.
Artists love to make prints, don’t they? Some queries fancy themselves as artists, printing their own works of mysterious art. What do they produce? Why are the lines so long? Seeing the plan through this small frozen window leaves the viewer wanting to know more. Sometimes, though, you take one look at a plan and you don’t want to know any more whatsoever:
Even SSMS can’t handle the zoom-out feature on this particular work of art. It cries out for mercy with a blood-red X, signifying that it’s been wounded. Everything is mortal, even software. Ain’t art grand?
Learn More in Our Execution Plan Training
Our How to Read Execution Plans Training explains how to get an execution plan, how to read the operators, and learn solutions to common query problems.