Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Paul White
»
Inside the Optimizer: Constructing a Plan -...
32 posts, Page 1 of 4
1
2
3
4
»
»»
Inside the Optimizer: Constructing a Plan - Part 1
Rate Topic
Display Mode
Topic Options
Author
Message
Paul White
Paul White
Posted Monday, September 06, 2010 8:11 PM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:49 AM
Points: 10,990,
Visits: 10,540
Comments posted to this topic are about the item
Inside the Optimizer: Constructing a Plan - Part 1
Link to
Part 2
Link to
Part 3
Link to
Part 4
Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #981280
ChrisM@Work
ChrisM@Work
Posted Tuesday, September 07, 2010 2:56 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 9:27 AM
Points: 5,618,
Visits: 10,990
Feature-packed and very readable article as always Paul.
It's a little like watching your favourite tv program - just as you're really getting into it, you reach the end and the credits roll. Can't wait for the next installment
“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.”
- Gail Shaw
For fast, accurate and documented assistance in answering your questions, please read
this article
.
Understanding and using APPLY, (I)
and
(II)
Paul White
Hidden RBAR: Triangular Joins
/
The "Numbers" or "Tally" Table: What it is and how it replaces a loop
Jeff Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #981401
SQL Curious
SQL Curious
Posted Tuesday, September 07, 2010 7:35 AM
SSC Rookie
Group: General Forum Members
Last Login: Wednesday, July 06, 2011 1:36 PM
Points: 43,
Visits: 29
Great article. I look forward to the series.
Can you help me understand the difference in the Nested Loops operator between the first and second plan? Other than the '!' point warning symbol in the first plan they look the same to me. How can you tell one is doing a Cartesion Join while the other is doing an Inner join?
Post #981567
george sibbald
george sibbald
Posted Tuesday, September 07, 2010 7:39 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 9:09 AM
Points: 5,270,
Visits: 11,211
should make for an interesting series.
How do you turn off rules in the optimiser?
Or is that something its best not to know? (or put in print)
---------------------------------------------------------------------
Post #981573
Hugo Kornelis
Hugo Kornelis
Posted Tuesday, September 07, 2010 8:01 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 3:22 AM
Points: 5,244,
Visits: 7,059
I agree with the previous comments - great article!
jim.jaggers1 (9/7/2010)
Can you help me understand the difference in the Nested Loops operator between the first and second plan? Other than the '!' point warning symbol in the first plan they look the same to me. How can you tell one is doing a Cartesion Join while the other is doing an Inner join?
The exclamation point symbol is not related. This simply indicates an warning from the optimzier - usually an indication of missing statistics.
In the exectution plan, you can find the difference by checking the properties of the operators (you can see them by hovering your mouse over them, or by right-clicking, selecting "properties", then clicking the operators you want to check).
If the filtering is done before the join, then you will see a "predicate" property on the scan before (to the right of) the join operator. (Or a "seek predicate" property if it's a seek). In this case, the join itsself is technically still a cartesian join, but on pre-filtered inputs (as if you write ... FROM (SELECT ... WHERE ...) AS a JOIN (SELECT ... WHERE ...) AS b ON ...)
If the filtering is done during the join, then you will see a "predicate" property and/or "outer references" property on the join operator. This is a true non-cartesian join (inner join, unless the operator is an outer join operator).
If the filtering is done after the join, you'll see a "predicate" or similar property on one of the operators after (to the left of) the join operator. Usually a filter operator. In these cases, the join was a "true" cartesian product.
Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog:
http://sqlblog.com/blogs/hugo_kornelis
Post #981595
Paul White
Paul White
Posted Tuesday, September 07, 2010 9:08 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:49 AM
Points: 10,990,
Visits: 10,540
george sibbald (9/7/2010)
How do you turn off rules in the optimiser?
Everything (in detail) will be revealed in subsequent parts...stay tuned
Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #981639
Paul White
Paul White
Posted Tuesday, September 07, 2010 9:13 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:49 AM
Points: 10,990,
Visits: 10,540
jim.jaggers1 (9/7/2010)
Can you help me understand the difference in the Nested Loops operator between the first and second plan? Other than the '!' point warning symbol in the first plan they look the same to me. How can you tell one is doing a Cartesion Join while the other is doing an Inner join?
The exclamation point is shown where compiler warnings occur. In this case the warning is: "No Join Predicate". A cartesian product is a join with no join predicate. The other visual clue is that the size of the arrow on the output of the join is *huge* - indicating a very large number of rows.
Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #981643
WayneS
WayneS
Posted Tuesday, September 07, 2010 10:24 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 9:12 AM
Points: 6,370,
Visits: 8,235
It's too bad we're limited to just 5 stars...
Great article Paul.
Have you got some references you can pass on about how the optimizer works?
Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then
DON'T USE IT
on a production system! After all,
you
will be the one supporting it!
Links:
For better assistance in answering your questions
,
How to ask a question
,
Performance Problems
,
Common date/time routines
,
CROSS-TABS and PIVOT tables Part 1
&
Part 2
,
Using APPLY Part 1
&
Part 2
,
Splitting Delimited Strings
Post #981695
Paul White
Paul White
Posted Tuesday, September 07, 2010 10:58 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:49 AM
Points: 10,990,
Visits: 10,540
WayneS (9/7/2010)
Have you got some references you can pass on about how the optimizer works?
For sure:
Craig Freedman:
http://blogs.msdn.com/b/craigfr/
SQL Server Storage Engine:
http://blogs.msdn.com/b/sqlserverstorageengine/
CSS:
http://blogs.msdn.com/b/psssql/
Query Processing:
http://blogs.msdn.com/b/sqlqueryprocessing/
White Papers:
http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx
SQLCAT:
http://blogs.msdn.com/b/sqlcat/
Conor vs. SQL:
http://blogs.msdn.com/b/conor_cunningham_msft/
Programmability & API:
http://blogs.msdn.com/b/sqlprogrammability/
Bart Duncan:
http://blogs.msdn.com/b/bartd/
Conor @ SQLskills:
http://www.sqlskills.com/blogs/conor/
QO Team:
http://blogs.msdn.com/b/queryoptteam/
Joe Chang:
http://www.qdpma.com/CBO/SQLServerCostBasedOptimizer.html
The SQL Server Internals books edited by Kalen Delaney are also excellent sources. Optimizer stuff is covered particularly well in 2008 Internals (Conor Cunningham) and 2005 Query Tuning & Optimization (Craig Freedman).
Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #981725
Paul White
Paul White
Posted Tuesday, September 07, 2010 11:12 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:49 AM
Points: 10,990,
Visits: 10,540
Chris Morris-439714 (9/7/2010)
Feature-packed and very readable article as always Paul.
It's a little like watching your favourite tv program - just as you're really getting into it, you reach the end and the credits roll. Can't wait for the next installment
Thank you, Chris. Steve did an excellent job with the scheduling on this four-part series, so you'll get Part 2 on Thursday, and Parts 3 & 4 on Tuesday & Thursday next week. The graphics are best in Part 1, but the content gets better in the later parts
Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #981741
« Prev Topic
|
Next Topic »
32 posts, Page 1 of 4
1
2
3
4
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.