Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Cardinality Regression Expand / Collapse
Author
Message
Posted Saturday, May 31, 2014 1:24 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 5:25 PM
Points: 31,081, Visits: 15,528
Comments posted to this topic are about the item Cardinality Regression






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1576380
Posted Saturday, May 31, 2014 9:12 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 2,011, Visits: 5,485
Good question, thanks Steve.

Still some confusion in the documentation at support.microsoft.com:
The following plan affecting trace flags are available in Microsoft SQL Server 2014:

9481
Use when running SQL Server 2014 with the default database compatibility level 120. Trace flag 9481 forces the query optimizer to use version 70 (the SQL Server 2012 version) of the cardinality estimator when creating the query plan.

2312
Use when running SQL Server 2014 with database compatibility level 110, which is the compatibility level for SQL Server 2012. Trace flag 2312 forces the query optimizer to use version 120 (the SQL Server 2014 version) of the cardinality estimator when creating the query plan.
Post #1576403
Posted Sunday, June 1, 2014 9:10 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 1:33 PM
Points: 2,980, Visits: 3,013
Confusion!?

2312 - http://support.microsoft.com/kb/2801413
Use when running SQL Server 2014 with database compatibility level 110, which is the compatibility level for SQL Server 2012. Trace flag 2312 forces the query optimizer to use version 120 (the SQL Server 2014 version) of the cardinality estimator when creating the query plan.

9481 - http://msdn.microsoft.com/en-us/library/dn600374%28v=sql.120%29.aspx
Once your workload is running with the new cardinality estimator (database compatibility level 120), and a specific query has regressed, you can run the query with trace flag 9481 to use version 70 (the SQL Server 2012 version) of the cardinality estimator.

Since you don't have the option for trace flag 9481, then changing the compatibility level to 110 is the right answer.




Igor Micev,
SQL Server developer at Seavus
www.seavus.com
Post #1576416
Posted Sunday, June 1, 2014 9:19 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 2,011, Visits: 5,485
Igor Micev (6/1/2014)
Confusion!?

2312 - http://support.microsoft.com/kb/2801413
Use when running SQL Server 2014 with database compatibility level 110, which is the compatibility level for SQL Server 2012. Trace flag 2312 forces the query optimizer to use version 120 (the SQL Server 2014 version) of the cardinality estimator when creating the query plan.

9481 - http://msdn.microsoft.com/en-us/library/dn600374%28v=sql.120%29.aspx
Once your workload is running with the new cardinality estimator (database compatibility level 120), and a specific query has regressed, you can run the query with trace flag 9481 to use version 70 (the SQL Server 2012 version) of the cardinality estimator.

Since you don't have the option for trace flag 9481, then changing the compatibility level to 110 is the right answer.


Check this thread
Post #1576417
Posted Sunday, June 1, 2014 11:59 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 4:57 PM
Points: 7,745, Visits: 9,493
When I saw this, I found myself wondering if this were the documentation bug again or not? It could be a trick question, where the "correct" answer was the only answer provided that would run teh query with the old cardinality estimator, so the poor practice answer (use compatibility level) would be "correct" despite being poor practice for dealing with a single query rather than all queries in a DB. After all, it was just over a fortnight since STeve's last question on this topic and the documentation error was thoroughly aired then, surely he would have correted this one by now?
Anyway, in the end I decided it was probably a repeat of believing teh wrong BOL page and got it right by selecting an option that wouldn't actually work.


Tom
Post #1576431
Posted Sunday, June 1, 2014 1:08 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 2,011, Visits: 5,485
TomThomson (6/1/2014)
When I saw this, I found myself wondering if this were the documentation bug again or not? It could be a trick question, where the "correct" answer was the only answer provided that would run teh query with the old cardinality estimator, so the poor practice answer (use compatibility level) would be "correct" despite being poor practice for dealing with a single query rather than all queries in a DB. After all, it was just over a fortnight since STeve's last question on this topic and the documentation error was thoroughly aired then, surely he would have correted this one by now?
Anyway, in the end I decided it was probably a repeat of believing teh wrong BOL page and got it right by selecting an option that wouldn't actually work.


+1 (Ditto)
Post #1576433
Posted Sunday, June 1, 2014 3:08 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:15 AM
Points: 13,017, Visits: 10,800
Gah, again!

I have found so many resources (not only MSDN) saying trace flag 2312 is used to run a query with the new cardinality estimator, not to disable it.
So the only correct option would have been to set the compatibility level...




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1576440
Posted Sunday, June 1, 2014 3:10 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 1:33 PM
Points: 2,980, Visits: 3,013
Eirikur Eiriksson (6/1/2014)
Igor Micev (6/1/2014)
Confusion!?

2312 - http://support.microsoft.com/kb/2801413
Use when running SQL Server 2014 with database compatibility level 110, which is the compatibility level for SQL Server 2012. Trace flag 2312 forces the query optimizer to use version 120 (the SQL Server 2014 version) of the cardinality estimator when creating the query plan.

9481 - http://msdn.microsoft.com/en-us/library/dn600374%28v=sql.120%29.aspx
Once your workload is running with the new cardinality estimator (database compatibility level 120), and a specific query has regressed, you can run the query with trace flag 9481 to use version 70 (the SQL Server 2012 version) of the cardinality estimator.

Since you don't have the option for trace flag 9481, then changing the compatibility level to 110 is the right answer.


Check this thread

Hm, ah, aham, ok. :)




Igor Micev,
SQL Server developer at Seavus
www.seavus.com
Post #1576442
Posted Sunday, June 1, 2014 3:21 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 2,011, Visits: 5,485
d. There is nothing you can do except update your resume

Smells like irony...
Post #1576447
Posted Sunday, June 1, 2014 11:32 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
Thank you, Steve. Easy One.

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Post #1576463
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse