SQL Server DBA

Rob Farley on Joins

So this is a cheat, this isn’t my blog post at all, but a colleague recently pointed me towards a talk Rob Farley gave on Designing for Simplification and it was just too good to not blog about. I have yet to watch the whole video and I am yet to be completely sold on the beauty of a view. But Farley has an exceptional ability to communicate. I will definitely watch it all, I will very definitely be playing with these ideas in a SQLLab and I will probably devour his blog as if it was going extinct!

The part of this video that really hit me was Farley’s description of a join. He manages to entirely describe joins in 4 ways, they either:

  1. Add columns
  2. Eliminate Rows
  3. Duplicate Rows
  4. Add NULLs (this was the only one I didn’t like – I think preserve rows might be more apt?)

To me, these four things encapsulate the motivation and effects of all joins. And that is exceptional in its simplicity. Farley writes about this in slightly more detail in his blog post: JOIN Simplification in SQL Server.

Its funny, because I am trawling through the official study guide for Microsoft’s T-SQL exam, and have just spent solid time on 3 chapters that really fascinate me – aggregating data, GROUP BY and WINDOWING functions. This area of data manipulation fascinates me, and yet I felt that these 3 chapters had been written lazily. Whoever has authored these chapters has done a fantastic job of documenting these functions, but have completely failed to communicate the concepts. I apologise to whoever wrote these chapters – I am not just unleashing my frustration here – I really respect the work done. But what Farley has managed to do in 4 bullet points is genius and it is the difference between documentation and communication.

I have been incredibly lucky to have had some great mentors over the past 10 years. For me the mentors who really stood out were exceptional communicators. In particular, Wally had a view of tennis that was unique and he was exceptionally good at getting this across – the simplicity with which he viewed the game was awesome, a little intimidating and incredibly challenging. Whereas, Anthony had an ability to convey his views and adapt his style of communication to suit any audience.

Watching Farley’s talk on designing for simplification, I was struck with similarities between his ability to communicate and those same abilities I respected in Wally and Anthony. I can confidently say that these four qualities of a join where not new to me – but I could not have phrased it so completely or so elegantly as Farley does here. It’s more than just being able to get the right words out; when you can view something so simply, you begin to understand it more completely. Where before a wide running forehand would have you on defense, all of a sudden it is a weapon. Where before you would experiment with various joins, all of a sudden you appreciate the qualities of the result you are aiming for and you instinctively choose the right tool.

One day I might be lucky enough to go to a conference where Farley is presenting (having watched this video, I can’t believe I didn’t go to SQL Saturday in Christchurch last week!!!) and I might be lucky enough to thank him. It’s more than 4 points about joins; it’s a whole style of approach that is inspiring.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s