SQL Centre of Excellence

Whops I accidently deleted the original list of questions. Like a true data professional I don’t backup my  blog. Here’s of the original questions.

Internals

1. What’s an example of a legacy LOB type v new LOB Type ?

2. Are Legacy LOB Types stored on/Off row by default

3. Are New LOB Types stored on/off row by default ?

4. How can you change this behaviour for legacy LOB Types?

5. How can you change this behaviour for New LOB Types?

6. If you change row storage for a LOB from “on row“ to “off row” on a 100GB database how long will it take ?

7. How big in bytes is the “version tag” for versioned rows and what does it store ?

8. How often to PFS pages appear in a data file?

9. How often to IAM pages appear in data file?

Index Strategies

1. A table has 1,000 pages with 100 rows per page. A query on an (select * from blah where MyColumn=1) column returns 500 rows and there is an index on MyColumn. Will it use the index if the index is non-clustered?

2. Can an index include LOB data types?

3. How big can the clustered Index Keys on a Materialised View be?

4. Recommend TWO Ways to get rid of unused indexes if you have a representative trace file

Log Internals

1. Is there such a thing as a non-logged operation ? If so, examples?

2. How Can you get minimally logged inserts on a clustered table with rows in it ? (specify two things to do)

3. A Developer issues a begin tran followed by an update and then a checkpoint. Are the changes written to disk in the checkpoint ?

4. How do you resolve a “checkpoint IO storm”

5. Someone creates a 1GB log file. How many VLF’s are there ?

6. Is a log backup smaller or larger with BULK_LOGGED than with FULL logging mode ?

7. Is rebuilding of an index in simple mode minimally logged?

8. Is re-org of an index in simple mode minimally logged?

9. You need to update a 100GB BLOB when in bulk logged mode. Can this be done minimally logged? If so, how?

10. If you switch from full to bulk and then MDF corrupts. Can you backup the tail log ?

11. How can you make the log file initialisation faster ?

Statistics

1. How many steps are in a stats histogram

2. Are histogram values left or right based?

3. What can cause a recompile (there are 14 events). List as many as you can.

Here are the slide decks and sample source code from the SQL/Dot.Net performance tuning MasterClass. I hope that there was some food for thought there.

The password is the name of the company who wrote the DVD Store application.

Decks Decks

We do a LOT of performance tuning and troubleshooting work. My rates aren’t the cheapest in the book, but you pretty much know that when you call Prodata or I’m sure any good performance consultant things are going to improve.

Often, i walk in a room with 5-10 experienced professionals and they aren't making much headway to resolving issues, but things start to go forward when we get involved. Why is this ? well here are four common troubleshooting methodologies commonly used. See if you recognise them ;-)

1. The Six Shooter

Walk into the room like John Wayne listen a bit  and start making suggestions. Try them and see if it works. This is the most common approach and the fastest. if your first bullet hits – problem solved. Ride onto the next ranch and go the pub the hero. The more experienced you are the better the chance of a good hit.

The problem comes when you are reloading your gun for the 10th time and are six hours later – do you even know what your shooting at ?

Do we use this at Prodata – heck yeah. Nothing better than walking in a room, taking a shot hitting the target and walking out. Just one simple rule – you get only one bullet for every 5 man years tuning experience (or children you have).

Often I’ll break up a session and say “ok – we’ve run out of bullets guys” – lets try another approach.

image

The six shooter can give you the fastest possible resolution, but it can also give you the longest, or never actually succeed in solving an issue.

2. The Shotgun

This is the approach we very commonly see in the field – usually when a project manager is running the show. They have a workshop, compile a huge list of ideas. Select the top 10 and then implement them all at once.

Not my favourite approach. The benefit is fewer iterations, but the down side is even if it does fix the problem does anyone actually know what the problem was ? What are you going to do if the same problem happens again ? fire the same shotgun blast ?

image

Do we use this at Prodata – not usually, but we do get involved in projects where we are not running the show and the PM style leads it this way. I’ll try to steer away from this if possible.

3 The Grenade (Or Nuke)

We don’t see this one much, out side of a political threat, or attempt to motivate a vendor or six shooter team into shooting faster. It may also be seen if there is a corporate terrorist in the midst of the project with an agenda.

image

The benefit of this one is it clears the field. Would I use this one ? Well maybe if we were taking over a half finished project and things are in bad shape. Do we troubleshoot and finish taking ownership of the nasty stuff, or hit the nuke button and rise from the ashes with a beautiful creation.

4. The Surgical Knife

This is closer to the sort of approach a tuning professional is going to take. Start with a high level health and configuration check (preferable using automated tools) and then move onto reproducing issues, measuring the problem, identifying where it hurts and fixing those areas in an iterative style.

The advantage of this approach is obviously that recommendations are based on observable evidence, so more likely to hit the pain points.

The disadvantage is often the “measure it” is a slow and expensive process time wise and it does need some experience to jump from the where does it hurt to the fix it. The health check may throw up some quick wins, but in SQL Server terms the workload analysis is going to need a trace file or some major delving into DMV’s,  perfmon counters, etc. Maybe a harness will be needed.

image

One major blocker for this approach is the “reproduce it” step. What if the problem only happens on the production server at 3am and no one is allowed access to the server to instrument anything ?

Test Post on Azure Platform

by Bob Duffy 12. February 2013 15:12

We moved our blogs over to Windows Azure now as a Pilot.

Quite a nice experience so far…

My Upcoming Seminars

by Bob Duffy 8. February 2013 10:14

So far has been a busy start to the year. I have kicked off some new BI projects in the office, lots of performance tuning, capacity planning, upgrade projects, and hopefully some exciting announcements coming soon as we launch a new company. so has been a bit quiet on the blog front ;-)

I have a few upcoming seminars that might be of interest. One in Dublin and Two at the next SqlBits in Nottingham. I’m also hoping to make it over to some SqlSaturdays – maybe the one in Edinburgh and Denmark:

- http://sqlsaturdayedinburgh.com/

- http://www.sqlsaturday.com/196/eventhome.aspx

 

1. Optimising the SQL Platform for dot.net Solutions – Thurs 28/02/2013

We aim to offer guidance on how to design your Data Access Strategy to make the right choices for performance, and the how to monitor and tune a SQL workload by making common change in dot.net to improve performance and scalability. A focus is on the dot.net platform but many concepts are equally applicable to Java and other platforms.

First we will demonstrate design choices dot.net offers to interface with SQL Server when using ADO.Net and benchmark the impact on performance, then we will take a sample application running in a load test harness and show common performance worst practices, how to correct them and the impact on performance.

  • Module 1 - Dot.Net Data Access Fundamentals.
  • Module 2 - SQL/dot.net Performance Tuning Methodology and Tools.

2. SQL 2012 Always on Deep Dive Fri 03/05/2013

Always On Availability Groups offer a huge leap forward in terms of high availability. This sessions is a demo based introduction to the high availability changes in SQL 2012 emphasizing key features and benefits.


During the demonstration we will show how to seamlessly upgrade a database from SQL 2005+ to SQL 2012 with ZERO down time and then use the Availability Group features to simplify reporting, availability and disaster recovery.

This session will be useful for anyone who is working in a high availability environment or currently using replication to provide reporting and looking for a neater solution.

3. Windows Azure for SQL Folk Sat 04/04/2013

So what is this cloud stuff and how does it affect database professionals ?

In this session we aim to cover the fundamental concepts that you should know on the Cloud and Windows Azure. In this demo based hour we will step through building Azure applications, deploying and managing them and what storage choices you have when developing applications in the cloud.


This sessions is Ideally suited to anyone who wants to understand more behind how Azure works, what it offers and what is probably just hype.

Our popular MasterClass series is having a session covering an Introduction to The Cloud and Windows Azure for database folk like you and me.

If you are looking to start a project in the “cloud” are just wanting to see what all the fuss is about then please do register and come along this Thurs (6th Dec).

Well be covering the new features in Windows Azure, showing SQL running as Infrastructure as a Service, Platform as a Services and demonstrating how to migrate and scale your databases in the cloud.

The link for the event is here:

http://www.prodata.ie/Events/2012/SQL-Azure_and_the_cloud.aspx

See you there!

Working with  large analysis services customer we found some complaints that users have to wait an additional 20-60 seconds to run basic reports on top of the usual time to warm up the calculation script.

The slow down only happens on a cold server restart, or if the service is shut down and disk un-mounted (which is common if you are doing scale out using SAN snapshots).

Using the SQL profiler we can see that following a “connect” command to analysis services the following XMLA command is issued as part of the connect process.

<RestrictionList xmlns="urn:schemas-microsoft-com:xml-analysis">
<ObjectExpansion>ExpandObject</ObjectExpansion>
</RestrictionList>
<PropertyList xmlns="urn:schemas-microsoft-com:xml-analysis">
<LocaleIdentifier>6153</LocaleIdentifier>
</PropertyList>

Using  the fantastic ProcessMonitor tool by Mark Russinovich and Co (Available Here) we can see a lot of small disk activity on the very first connect to the analysis server as all the databases are “mounted” and the xml meta data files for cubes, dimensions, attributes, measure groups and partitions are read from disk into memory in most cases using quite small IO sizes (2k). In our case this takes 25 seconds.

An example of some of the traffic interaction is below. You can see that following the first connection the definition files will be read from disk in 2K IO size, for pretty much every attribute, measure group and partition xml file.

image

This is a completely different approach that the SQL Server DB Engine which “mounts” databases during the start-up of the service.

What does this mean ?

I guess this means a few things:

1. Be careful of having too many databases in an analysis instance. The mounting is done for all databases at once on first user connect.

2. A warm-up script of some sort after service start-up is probably worthwhile on larger solutions, not just to warm up the calculation script and/or storage engine cache, but also to force the databases to mount.

What could the product do Better ?

some suggestions for the product team:

  • Mount the databases at service start-up (as per DB Engine). I would have through it would be more efficient to mount the databases at the service start-up (as an asynchronous process) rather than on the first connect by a user.

I added a connect item, but its pretty obscure improvement, so I’m not sure how much love it will get.

https://connect.microsoft.com/SQLServer/feedback/details/770592/delay-on-inital-connection-to-analysis-services

This was SQL2008R2, so I’m not sure if 2012 behaves differently.

One thing people come to us for is advanced performance tuning. No I don’t mean adding indexes to remove table scans I means complex issues involving either more sophisticated resource bottlenecks or problems with huge scale.

With this in mind we have two advanced tuning events coming up in November:

  • The first three day workshop is a deep dive for performance tuning and troubleshooting techniques on the database engine and is run by internationally recognised SQL Server expert and certified MCM Klaus Aschenbrenner.This is the first time Klaus has come to Ireland to present his popular performance tuning workshop. Level 300+
  • The second one day seminar is covering Super Scaling SQL Server. As the topic suggests this is not for the feint hearted. You’ll probably need either heave good experience with SQL server troubleshooting or have attended some of our other advanced performance sessions to get the most out of this session. Thomas Kejser is undoubtedly one of the greatest minds in the SQL server technical community when it comes to scale and performance. Level 400+

-----------------------------------------------------------------------------------------------------------------

SQL Server Performance Tuning & Trouble Shooting Workshop (3 days)

with Klaus Aschenbrenner , November 14th – 16th 2012, Dublin

Cost – €1,799

Registration: http://www.prodata.ie/events/2012/SQL-Performance_tuning_workshop.aspx

We all know the situation only too well, Friday evening and the weekend is flirting with you promisingly ….. then the dreaded email arrives telling you that your SQL Server has enormous performance problems.

What can you do to identify the problem and resolve it quickly? Which SQL Server tools will help you rescue your free time, or in the absence of a good weekend plan, can help you free up time for more fulfilling and proactive tasks?

This course is delivered by Klaus Aschenbrenner, author of Pro SQL Server 2008 Service Broker. Over the course of this 3-Day workshop Klaus will:

- Delve into the most prominent performance bottlenecks inside SQL Server

- Show you the different tools at your disposal to enable effective SQL Server performance troubleshooting.

- Teach you how to identify and resolve performance bottlenecks quickly

********************************************

Super-scaling SQL Server (1 day)

With Thomas Kejser, November 23rd 2012, Dublin

Cost - €799

Registration: http://www.prodata.ie/events/2012/SQL-super-scaling.aspx

This course is not for the faint-hearted…. In fact you could describe it as performance tuning on steroids. In one intense day, Thomas will take participants beyond indexes to the next steps in optimising the performance of their SQL Servers. It aims to take you beyond best practices, below the surface into the realm of measurement and KNOWLEDGE about why your implementation works or doesn’t.

Formerly of the SQL CAT Team, Thomas is now CTO of Fusion IO. Building multi-terabyte- sized data warehouses, setting up OLTP systems for extreme scale and tuning world record data movement speed are some of Thomas’ recent achievements.

The course is level 400+ and targets the sweet spot between designing for performance and maintaining performance and is therefore relevant to Architects, Developers and DBAs alike, and as for Consultants… you will be guaranteed a brand new power-tool in the tool box

The second in the series of the 2012 master class series is this Friday 26th October 2012 covering Mission Critical availability with a guest speaker, Microsoft Certified Master, and friend of Prodata: Gavin Payne.

http://www.prodata.ie/Events/2012/SQL-Mission_Critical.aspx

For those of you who have been to previous sessions you know what to expect. We plan to bring you expert level content and access to some of Europe's best SQL consultants covering popular topics relating to SQL Server. The session is packed into half a day to ensure that you can still get professional development and not miss too much of that precious work time. Super important if you are a billable consultant.

If you are thinking of planning or implementing high availability then this is a session you should not miss.

See you there !

On of the best events in SSIS is “OnPipelineRowsSent” as this gives you performance data on how many rows are flowing through buffers and is great for performance analysis.

Unfortunately I just found out the hard way that while it worked in SQL 2005 and 2012 it does not fully work in SQL 2008R2. Big doh!!

See this connect item for more details

http://connect.microsoft.com/SQLServer/feedback/details/724862/onpipelinerowssent-not-logged-by-dtexec

Page List

Page List