Be Cautious When Critizing About Guidance

T-SQL
I recently posted some comments about some guidance offered by Microsoft when talking about the CXPACKET wait type. Nothing I said was wrong, no. But, evidently there are a few whip smart and agile people who work for Microsoft. Specifically, Rick Byham, who works for the team tasked with taking care of the SQL Server Books Online. Why am I calling Mr. Byham smart and agile. Evidently he saw the blog post and has completely updated the description for CXPACKET at MSDN: Occurs with parallel query plans when trying to synchronize the query processor exchange iterator. If waiting is excessive and cannot be reduced by tuning the query (such as adding indexes), consider adjusting the cost threshold for parallelism or lowering the degree of parallelism. WHOOP! That's awesome work. Thanks Mr. Byham. Of…
Read More

RML Utilities and SQL Server 2012

T-SQL
I'm working through some code that I haven't touched recently and I'm running it for the first time on a SQL Server 2012 server. The code is a way to load information into the RML utilities and I started hitting errors. First, I hit an error that my server couldn't be connected to, but thanks to Erin Stellato (blog|twitter), I was able to quickly fix that. Then I hit this: Number of processors: 2 Active proc mask: 0x00000003 Architecture: 9 Page size: 4096 Highest node: 0 Package mask: 0x00000001 Processor(s): 0x00000001 Function units: Separated Package mask: 0x00000002 Processor(s): 0x00000002 Function units: Separated Processors: 0x00000003 assigned to Numa node: 0 -Ic:\performancetuning\rml.trc -oc:\bu -SDOJO\RANDORI Using language id (LCID): 1024 [English_United States.1252] for character formatting with NLS: 0x00060101 and Defined: 0x00060101 Attempting to…
Read More

Another Execution Plan… In the Cloud!

Azure
A couple of weeks ago I posted about how different execution plans look when using the Azure Management Portal. I promised to look at a more complex plan and here we are. The query looks like this: SELECT * FROM dbo.Agent AS a JOIN dbo.Resource AS r ON a.AgentId = r.AgentId JOIN dbo.MovieStageResource AS msr ON r.ResourceId = msr.ResourceId JOIN dbo.MovieStage AS ms ON msr.Movieid = ms.MovieID AND msr.MovieStageDefinitionId = ms.MovieStageDefinitionId JOIN dbo.Movie AS m ON ms.MovieID = m.MovieId WHERE a.AgentId = 42; I didn't go nuts in creating a crazy complex query. I just wanted to see a standard set of different operators to see how things changed. As before, I'm working off a controlled database that has identical structures and data in both the Azure database and my…
Read More

Execution Plans … In the Cloud!

Azure, T-SQL
If you’re moving to a fully-fledged SQL database as part of Azure you may never even touch SQL Server Management Studio (SSMS). Instead you may do all the management of your SQL database through the Management Portal. You can actually do everything you need to through this tool. This includes writing and testing T-SQL statements. Believe it or not, it includes execution plans. But, if you’re used to seeing this from a query: Then you may be a little bit surprised at this: Believe it or not, those are identical plans. Yeah, the graphics are different, radically so. But the plans, those are the same. I have a small test database that I have loaded into my local server and onto my Azure SQL Server database. It has identical structures…
Read More

SQL Server Log Backups

T-SQL
While presenting a session on Common Backup Problems both at SQL Saturday in Orange County and at SQL Connections in Las Vegas, questions came up regarding whether, when, and how your databases should be configured in FULL recovery mode and what that means for your recovery plans. To boil the questions down to as simple a single statement as possible: Should your database be in FULL recovery mode at all times which requires you to run log backups on a regular schedule? The same question came up while Brad McGehee(blog|twitter) was presenting a session on using the settings on your SQL Server instance and your database to ensure you got proper performance. We both answered the question the same way, but our emphasis was slightly different. Brad’s answer was that,…
Read More

Deadlock Monitoring

T-SQL
There are four different ways you can get information about deadlocks in your system. These are: traceflag 1204 traceflag 1222 trace events extended events For years I’ve been pushing traceflag 1222 as the best of the lot. Well, that’s over. I’ve been learning more and more about extended events and I’m currently in love with xml_deadlock_report event. Why? Simple, it has everything that traceflag 1222 has, but there are two glorious things about it. First, it’s not going to be filling up my error log with, for the error log, noise. Seriously. As much as I liked the information displayed from traceflag 1222, I didn’t like what it did to the log, but I saw it as a necessary evil. Second, it’s XML baby! That means you can set up…
Read More

Installing SQL Server 2012 RC0

Uncategorized
Very short informational post. If you’re like me and you’ve been running the public Client Technology Preview (CTP3) of SQL Server Denali, uh, I mean 2012, then the news about the release of RC0 is pretty exciting stuff… until you realize that you’re going to have to tear down your virtual test machine, removing the CTP in order to prep for the install of RC0. I love playing with the toys, but I hate working on the toys, if you know what I mean. Great news. You can upgrade from CTP3 to RC0 in place. I know because I’ve done it. When you run the install and you get to the screen that asks what type of install you want, select Upgrade, as highlighted below: I know it doesn’t say…
Read More

Extended Events Data

Uncategorized
I’ve been working quite a bit over the last week or so with extended events in Denali. The sheer magnitude of what you can do with extended events is just becoming clear to me. The interesting thing though is how much the basics are similar to trace. Similar mind you, not the same. For example, the best way to gather trace data is to output it to a file and then read the file into a table for later querying. It’s the same with extended events. There’s even a function that acts as a table: SELECT * FROM sys.fn_xe_file_target_read_file ('C:\APath\Query Performance Tuning*.xel', NULL, NULL, NULL); This can take advantage of roll-over files just like the old function used for traces. You can also provide offsets to read a sub-set of…
Read More