SQLSaturday Cleveland – Just Around the Corner

It seems like this winter is dragging along, especially if you live anywhere where it snows, as I do here in Cleveland.  But at the same, I cannot believe that our SQLSaturday event is less than two weeks away!  If you live within a couple hours of Cleveland, I strongly recommend that you check out our event, which is on Saturday, February 8, 2014 in Westlake, OH.  You can find the schedule here, but let me list a few highlights for you:

  • 42 sessions
  • 38 different speakers
  • 18 sponsors and counting
  • 13 SQL Server MVPs
  • 4 SQL Server MCMs
  • 2 Microsoft PFEs

We have an amazing line-up of speakers and I am so thrilled with the content our event will provide to our local SQL Server community.  We have speakers coming from all over the US – Washington, Colorado, Minnesota, Georgia, and Massachusetts – to name just a few states from which colleagues will be traveling.    Thank you to our speakers that will brave the cold, snow, and wind to come to Cleveland (I’m hoping for a heat wave where we get above freezing, but let’s be honest, Mother Nature hasn’t been very kind this year).

In addition to our fantastic day-of sessions, we also have two pre-cons for which you can still register!  Argenis Fernandez will be hosting A Day of SQL Server Internals and Data Recovery, and Allen White will present Automate and Manage SQL Server with PowerShell.  Registration details can be found on our main SQLSaturday page, and the cost for these pre-cons is a great deal.  Both speakers have been selected for pre-cons at the PASS Summit previously, and the rate for those events is much higher.  Don’t miss this opportunity!

If you have any questions about our SQLSaturday, please don’t hesitate to contact us.  We hope to see you next Saturday, February 8th, and until then, stay warm!

Statistics Starters Presentation: Scripts, the Database, and Some Answers

This past Tuesday I presented “Statistics Starters” for the PASS DBA Fundamentals Virtual Chapter.  You can read the abstract here, and as you may have guessed from the title, it was a 200 level session on statistics appropriate for anyone who knew of statistics in SQL Server, but wasn’t exactly sure how they were created, how they were updated, how to view them, etc.  Over 300 people attended (thank you!) and I had some great questions.  I plan to answer the questions in a series of posts, starting with this one.

Question: Can we get a copy of the scripts in your demo?  And where can we get a copy of the database you used?

Answer: The scripts, slide deck, and database can be downloaded from the SQLskills demos and databases resource page.  The database I used for these demos, which I plan to continue to use for presentations, is the Lahman baseball database.  While the AdventureWorks database is well known and widely-used, I admit that I have a hard time thinking of good Sales and Product examples in my demos.  I know baseball a lot better than I know sales 🙂

Question: Are we able to rollback newly created statistics if the plans created after an update are bad?

Answer: (edited 2014-01-23 2:45 pm) Great question.  The answer is no kind of.  This is one feature that exists in Oracle that I would be interested in seeing in SQL Server.  Oracle provides the ability to save and restore statistics.  You can even export statistics from one database and import them into another.  Pretty cool…potentially dangerous, but still cool; however, it is not possible to restore statistics in SQL Server if you save out the stat stream first, and then update the statistic with the stream.  Thanks to my colleague Bob Beauchemin (b) for pointing out how it can be done (I learn something new every day). Johan Bijnens also messaged me to point out that you can script out statistics – which I always forget.  The next step is to update statistics with stats_stream that you script out.  Take note: it is a hack.  Thomas Kejser blogged the steps here, and he has a fantastic disclaimer at the beginning because the method described is unsupported.  Before I write any more about the “feature”, I’m going to do a little testing and hacking of my own.  More to come!

Question: Why should I use the UPDATE STATISTICS command…isn’t sp_updatestats always the best option?

Answer: See my post Understanding What sp_updatestats Really Updates to see why I don’t recommend using sp_updatestats.

Question: Is it good to update statistics after rebuilding an index?

Answer: This is not recommended.  Remember that rebuilding an index updates statistics with a full scan – if you run a command to update statistics after a rebuild, you are wasting resources and the statistics may update with a smaller sample.   This is sometimes not ideal, because depending on the sample, it can provide less accurate information to the optimizer (not always, but it’s possible).

Question: Is it good practice to update statistics if I reorganize the index?

Answer: In general, yes, because reorganizing an index does not update statistics.  I recommend that you pro-actively manage your statistics, and not rely solely on automatic updates (assuming you have the AUTO UPDATE STATISTICS option enabled for your database).  If you are only reorganizing your indexes, make sure that you have another step or job that does update statistics.  If you either rebuild or reorg (or do nothing) based on the level of fragmentation, then you need to make sure you manage statistics accordingly (e.g., don’t update if a rebuild has occurred, do update if you’ve reorganized).

I’ll answer a few more questions in my next post, thanks for reading!

Refer a Friend, Get a Gift Card!

Yesterday I made this video:

Cold, snow, and wind in CLE

Notice at the end I mention Tampa and IE0? IE0 is our Immersion Event for Accidental DBAs and it’s a newer course that Jonathan and I teach.

Not an Accidental DBA?  Doesn’t matter, please keep reading 🙂

If you refer a friend or colleague for IE0 or IEHW – that’s Glenn’s two-day hardware classYOU get a $50 Amazon gift card!

See, I would bet that the Accidental DBA/Involuntary DBA/Junior DBA/person-who’s-managing-the-SQL-Server-instance-but-isn’t-quite-sure-what-they’re-doing does not read my blog.  They may not know about SQLskills, they might not even know who Paul and Kimberly are (it does happen…NO ONE in my extended family has ever heard of them, can you believe it?).

But you know that person needs training.  And we can help.

So reach out to a fellow member of your user group, a colleague at work, or someone you know is new to SQL Server, and let them know the Accidental DBA training that we provide.  You can send them this link to learn more about our training and Immersion Events, and if they sign up for IE0, they can learn how to keep their SQL Server up and running, and you can buy something you probably don’t need but really want (and you won’t have to share it because we won’t tell anyone you got a gift card).

And…in case you’ve been eying an IE course…today (January 3) is the last day for discounted pricing for Tampa classes! Book now, or book for one our May events in Chicago.

We hope to see you, and a friend, in 2014!