SQLServerCentral

Inside the SQL Server Query Optimizer


https://www.sqlservercentral.com/Forums/Topic1016648.aspx

By Site Owners - Friday, November 5, 2010 3:24 AM

Comments posted to this topic are about the item Inside the SQL Server Query Optimizer
By TheRedneckDBA - Friday, March 4, 2011 7:18 AM

Anyone know when this will be officially published?
By prarajesh - Sunday, April 3, 2011 4:57 PM

I don't know why the publishing is being delay for all the members as there are 899 views.


With regards,
Rajesh Prajapati
By Steven.Howes - Friday, February 8, 2013 12:20 AM

Publishing delays? I have this book on my shelf already.

A great read and definately worth the price (All the Red gate books are worth the price IMO).
By fleet 10349 - Wednesday, April 4, 2018 6:12 AM

I filled out the form but there was no download button. So how do I get the free e-book?
By Alan.B - Wednesday, April 4, 2018 7:50 AM

TheRedneckDBA - Friday, March 4, 2011 2:18 PM
Anyone know when this will be officially published?

In 2010 I think.
By Alan.B - Wednesday, April 4, 2018 7:54 AM

For those who have not read this book I highly suggest it. I picked up a physical copy at SQL In the City 2012 and could not put it down. Some of it is over my head (it is not a beginner book) but, if you spend a lot of time looking at execution plans (something you should be doing if your job involves writing T-SQL) then this book is a must read.
By t.ovod-everett - Thursday, April 5, 2018 3:56 AM

fleet 10349 - Wednesday, April 4, 2018 1:12 PM
I filled out the form but there was no download button. So how do I get the free e-book?

Fill out the form. Assuming you're in IE (similar steps for other browsers will probably work), right click on the book image in the blue pane and select "Inspect element". In DOM Explorer, scroll down a little and select the element below the highlighted one (the a tag with the body "Download your free eBook"). In the Styles page on the right, scroll down and locate ".hubspot-form-submit, iframe#download-form". Uncheck the line for "display: none;" Back in the browser page, click the newly-visible "Download your free eBook" button.
By david.stephens - Friday, April 6, 2018 7:16 AM

I had the same issue not seeing an obvious way to submit my information or download the book. I submitted a help request to their web support.
By Alan.B - Friday, April 6, 2018 9:02 AM

david.stephens - Friday, April 6, 2018 2:16 PM
I had the same issue not seeing an obvious way to submit my information or download the book. I submitted a help request to their web support.

See attached.
By t.ovod-everett - Friday, April 6, 2018 11:17 AM

A minor (and admittedly nit-picky) note on the book. On page 64, the following code shows up:
SELECT DISTINCT(Title)
FROM HumanResources.Employee
SELECT Title
FROM HumanResources.Employee
GROUP BY Title

I would suggest three edits to that code:
  • Add semi-colons to make it more explict that this is two separate queries.
  • Add a blank line between the two separate queries to further emphasize the separation.
  • Most importantly, eliminate the parentheses. DISTINCT is not a Function - it's a keyword that applies to SELECT and affects the result set as a whole (including all of the returned columns).
Similar code shows up on page 66. Additional uses of DISTINCT with parentheses are on pages 25 and 32 (twice).

By t.ovod-everett - Friday, April 6, 2018 11:37 AM

Another minor (admittedly nit-picky) note. On Page 72 I found, "Since both tables can potentially be scanned, the maximum cost of a Merge Join is the sum of both inputs." While reading this section, I started thinking about Merge Joins and wondering what Merge Joins do in a M:M join scenario. My first thought was that SQL Server might restrict Merge Joins not only to requiring sorted input, but also to requiring 1:M or 1:1 joins. My first thought turned out to be wrong! From Understanding Merge Joins, "A many-to-many merge join uses a temporary table to store rows. If there are duplicate values from each input, one of the inputs will have to rewind to the start of the duplicates as each duplicate from the other input is processed." I would argue that there should be a caveat on the Merge Join cost to include the cost of writing to the temporary table for M:M joins.