Well, this has been a great "conference season" but I'm also glad that it's over for a bit. In the past 4 weeks, Paul and I have been to Vienna (check out Paul's post here), Barcelona (for TechED EMEA ITPro), Las Vegas (for SQL Connections) and finally to Seattle (for PASS). We live in Redmond - about 15 miles from Seattle - so, this was a nice and rare "conference at home" but I have to admit that a conference "at home" is even a bit harder than one on the road. See, when we're on the road, we're only moments away from the conference (and often even in the hotel of the conference) and we don't have any of our regular "home obligations"... And, so, a conference "at home" is actually even harder to coordinate. And, wow, we almost got bitten by the Seattle traffic with it taking an hour to get into Seattle the day we did our PASS pre-conference workshop. However, we *did* start on time (ah, it was close though :).

And, so, after 4 weeks on the road, we're *finally* starting to post all of our demo scripts and continue to respond to all of the great emails we've received from folks (and, we have received quite a few!). Here's a quick rundown of what we did over these 4 weeks:

  • We delivered the equivalent of 7 days of lecture at a customer (we did 3 days together and then 2 days separated (with different teams))
  • We delivered 5 sessions and 4 ILLs at TechED EMEA
  • We delivered 2 full day workshops and 4 sessions at SQL Connections
  • We delivered a full day workshop and 2 sessions at PASS
  • I also joined in on the Women In Technology panel at PASS and it was *great* fun - we had a great discussion around advancing your career, how to start your own business (and network!) and just in general, how to strive to have a better work/life balance (and, as many admit - this is NOT super easy regardless of whether you're a woman or a man!!)

And, now we're tired... Actually, it's amazing how much energy I seem to have when I'm presenting but when all of these events are over, wow can I sleep! In fact, this weekend I've been a bit in a haze just starting to adjust back to regular-non-conference life... and, it's included a lot of Blokus with the kids and some Wii time.

So... check out our "Past Events" page as we've posted all of our demo scripts there. And, if for some reason I missed a script that you remember but can't find... let me know. I'll either add it to the zip (and let you know) and/or respond with a blog post on it. There are definitely some really good scripts and some interesting demos in terms of internals, indexing for performance, optimizing procedural code, etc. and so I'm happy to find that script and send it to you if for some reason you can't find it (and/or I forgot - which is always possible?! :)).

Finally, DVDs... over these past few weeks there have been a lot of DVDs flying around. For some events, we handed out DVDs. And, for some events - we just found out - Microsoft handed out DVDs (specifically the SQL Server 2008 Resource Kit - a 3-DVD pack). So, I thought I'd write a bit here to clear up the madness because one of the Resource kit DVDs is actually the same as one of ours - but, with all of the files renamed (and, for virtually no reason). There is one *tiny* difference - which I'll explain - but, I thought I'd clear everything up so that we're all on the same page, per se.

The DVD we handed out: SQL Server 2008 Hands-On Lab DVD, August 2008
This is a packed DVD that includes a self-extracting executable to create a virtual PC environment. There's a "Readme1st.txt" file which gives you a bit of insight into the requirements (16GB of disk space for the virtual PC hard drive (.vhd) and 1.5GB of memory - by default - for the virtual PC). The DVD also includes all of the labs manuals in .doc form. This DVD was created in August (make sure it says "August 2008" on the right hand side) and there are some specific setup/installation steps that you need to do to get everything "up to date". Check out my blog post on these instructions here: http://www.sqlskills.com/BLOGS/KIMBERLY/post/SQL2008HOLsVPC-setup-instructions-and-a-note-for-the-August-2008-release.aspx. This VPC expires on December 31, 2009.

The SQL Server 2008 Resource Kit - DVD #2
This is a 3-DVD set. I haven't reviewed all of the DVDs but a few folks were asking about the 2nd DVD so I grabbed a copy to check it out. It turns out that the second DVD is the same as the August 2008 DVD - with one exception. After I burned about 1000 of our August DVDs, I found out about the password expiration (which is explained/fixed in the setup instructions in the link here/above) and rebuilt a new image for the SQL team. However, instead of using that image - they renamed it and rebuilt it again (not sure why - other than to rename it). Anyway, on DVD2 of the SQL Server Resource Kit you can run the exe in the root and it will bring up a nice interface (ok, this is nicer than ours but - it's also a bit confusing). The interface is confusing because it says that you need to "DOWNLOAD" the virtual PC (and, a few folks asked me about how long it would take to download - because it's 4GB+). Anyway, there's NOTHING to download (luckily!!), it's actually on the DVD in the DVD:\AlwaysOn subdirectory. See, this is the frustrating part... about 3 years ago I created a DVD that was called "the AlwaysOn DVD". Unfortunately, (since then) all of my HOLs DVDs seem to be named this - even though they're definitely NOT all AlwaysOn Technology related. And, I had renamed it (on my version)... and, well, they renamed it back on the resource kit. LOL. In the end, it really doesn't matter. I'm just *VERY* happy to see that this content is freely available (yeah!) and that it's included in the Resource Kit. Finally, if it turns out that you can actually order this... I'll let you know. I've got an email off to a few folks to see if it's possible.

And, there was still some interest in SQL Server 2005 Hands-On Labs (yes, the SQL Server 2005 Always On Technologies DVD and the SQL Server 2005 Manageability DVD - which were combined into one for SQL Server 2008) and well... since I was home... I grabbed some of these *EXPIRED* DVDs (DVDs that were earmarked for the bin). And, I just want to make sure (if you requested one) that people know there's a trick to using "expired" DVDs... Before the DVD expires - you need to disable the Virtual PC clock synchronization (so that the VPC does NOT pick up your computer's local time). As a result, you can set the date inside the virtual PC back even further. This is something that I've read about on other blogger's blogs. So, do a "windows live search" :) :) and check out how to disable the virtual PC clock synchronization.

What's going on right now?
Paul and I have a few more weeks of craziness. We're still completing our writing for the new SQL Server 2008 Internals book by Kalen Delaney (available for pre-order here) - she's doing the lion's share of the work (I don't know how she does it!!) and we're each writing a chapter (Paul on DBCC, Conor Cunningham on the QP, Adam Mechanic on XEvents/Profiling and me on Indexing - not a surprise for me/Paul, eh?). We're also editing/working on a new title called the SQL Server MVP Project - with Paul Nielsen. PaulN really had the initial idea and drive for this project and there are a few editors (PaulN, Kalen, Adam, Greg Low, Paul [Randal], and myself) bringing everything together from dozens of Microsoft SQL Server MPVs. For this project, many MVPs have submitted a topic or two and in it they are describing a tip/trick and/or best practice - so this title will be all about tips and tricks from the trenches AND the title will completely go to benefit a children's charity (Steve Balmer had challenged MVPs to "give more" at the MVP Global Summit 2008). And, next week, I'm heading off to Dublin for a week (and, I'm speaking at their local SQL Server user group - again - as we were just there in Sept!) and then after that, it's time to relax for the holidays............... yippie! Next year we'll being heading west a lot more (India, Thailand, Australia...). We'll keep you posted for sure!!

I hope everyone's had fun at these conferences and may all your queries/procedures be optimized!

Thanks for reading,
kt

This is something that both Paul and I want to research more but, there have been a lot of questions about this recently. So, I thought I'd pull together a quick post of some important resources if you're interested in virtualization.

1) You should know what the support implications are - Bob Ward (Microsoft PSS Principal Escalation Engineer extraordinaire) - has blogged about the support implications here: SQL Server Support in a Hardware Virtualization Environment

2) You should know some of the best practices in configuration and setup - and the SQL team (specifically the SQLCAT team) has just recently released a whitepaper: Running SQL Server 2008 in a Hyper-V Environment - Best Practices and Performance Recommendations.

3) Finally, here are a few additional - and helpful resources: 

  • SQL Server's virtualization section on microsoft.com: http://www.microsoft.com/sqlserver/2008/en/us/virtualization.aspx which has a lot of links/resources/references.
  • If you're a SQL Server Magazine subscriber, check out Demystifying SQL Server Virtualization by Mike Otey in the the September 2008 edition of SQL Server Magazine

Have fun and post back with any issues on virtualization that you've run into!

kt

Way back in June 2005, I blogged about '8 Steps to better transaction log throughput'. I did this blog post after seeing (again and again) overly fragmented transaction logs... Transaction logs can become *VERY* fragmented when they are not preallocated and instead they grow excessively through unmanaged (and probably the default settings for) auto-growth.

While having WAY too many VLFs because of auto-growth is still the most common form of problem within transaction logs, another problem has been creeping up more and more... too few VLFs. If you preallocate a very large transaction log (10s to 100s of GB), SQL Server may only allocate a few VLFs - as a result, log backups will be allowed to run normally but, SQL Server only clears the inactive VLFs when you've moved into a different VLF. If your VLFs are 8GB in size, then you need to accumulate 8GB of log information before the log can be cleared...so, many of your log backups will occur normally but then one (the one that finally hits > 8GB in used size) will take quite a bit more time AND possibly cause you performance problems because it's now clearing 8GB of log information.

First, here's how the log is divided into VLFs. Each "chunk" that is added, is divided into VLFs at the time the log growth (regardless of whether this is a manual or auto-grow addition) and it's all dependant on the size that is ADDED not the size of the log itself. So, take a 10MB log that is extended to 50MB, here a 40MB chunk is being added. This 40MB chunk will be divided into 4 VLFs. Here's the breakdown for chunksize:

chunks less than 64MB = 4 VLFs

chunks of 64MB and less than 1GB = 8 VLFs

chunks of 1GB and larger = 16 VLFs

And, what this translates into is that a transaction log of 64GB would have 16 VLFs of 4GB each. As a result, the transaction log could only clear at more than 4GB of log information AND that only when it's completely inactive.

To have a more ideally sized VLF, consider creating the transaction log in 8GB chunks (8GB, then extend it to 16GB, then extend it to 24GB and so forth) so that the number (and size) of your VLFs is more reasonable (in this case 512MB).

Have fun and thanks for reading!!
kt

PS - I've been made aware of a bug when you use an exact size of 4096MB. I'll get more details and post them here but the long story short is to avoid 4096MB as an exact value. I've been told (and I haven't played with this one yet), that 4095 doesn't have the problem. Oh, and the problem is that the 4GB does NOT get divided into equally sized VLFs.

There's a new feature of SQL Server 2008 that during beta was called a Configuration Server... In RTM it was renamed to a Central Management Server. It's not overly obvious and without knowing how cool it can be - you might skip right by it. And, if you're using SQL Server 2008 to manage 2000, 2005 and 2008 servers - this actually works for all of those (and can be quite cool).

In the "Registered Servers" pane, expand the "Database Engine" option to see this feature. It's basically a separate option in addition to Local Server Groups. Right-click to register a Central Management Server.

A Central Management Servers (at first glance) seems as though it's solely a way to store server groups and registered servers - centrally - so that you (and your team) have easier access to the registration properties of a group of servers. And, in setting it up, adding groups, and registering servers - well, it doesn't seem like it is any different. In fact, that's all it is - in terms of creation. However, there are new options in terms of how to use it. It definitely IS different! In fact, it's in this simplicity (and the options it exposes) that lies its coolness. Let me show you :)

On a VPC (that we typically use for demos/labs, etc. for SQL Server 2008), we have 5 instances installed (SQLDev01, SQLDev02, SQLDev03, SQLExpress and ConfigServer). All instances (except Express) are SQL Server 2008 RTM Developer Edition and they're just simply named instances (there is no special designation (other than its name) for "ConfigServer"). I created the "ConfigServer" instance as a "server to hold configuration and general centralized management features - like Policy-Based Management, the management data warehouse for Performance Data Collection, a Master Server (for Master Server/Target Server Administration), and even a centralized management server. For many of these things you'll want to use a non-Express Edition of SQL Server as some features won't work on SQL Express (I'll explain more on this later). So, for this example, I'm going to use the ConfigServer instance (note: Centralized Management Servers *DO* work with SQL Express - something I previously thought was not possible... and, this is WAY cool). Regardless, the overall features that I plan to use with this server (like Policy-Based Management) require a version other than SQL Express so I'm going to use a Developer Edition instance for this centralized management server.

OK, so in this case, I created two groups (Development and Production) and each group has servers...

If I right-click on ANY level (a specific server, a group, or the Centralized Management Server itself) then you get multiple options as seen above:

  • New Query
  • Object Explorer
  • Evaluate Policies
  • Import Policies

In this case, I'm going to right-click on the Production Group and choose New Query – this opens a query window with one slight difference. The status bar at the bottom has a different color. OK, I bet you won’t even really notice this but a regular query window has a pale yellow status bar. A centralized management server query window has a pale pink status bar. I find that this isn’t overly noticeable – so I change it to a much more bold color (fuschia!). To change this, use Tools, Options, Text Editor, Editor Tab and Status Bar and then change the setting for the Group Connections option under the Status Bar Layout and Colors section. Anything that stands out is preferred. The reason why will be apparent soon…Within this query window, anything I execute will be executed against each of the servers in this group. I can even choose to execute a query against the centralized management server itself and this will execute against every server in every group. Powerful, but potentially-too-easily dangerous.

Here, I’ll execute SELECT @@version against the Production group:

The default behavior is that this is executed against all servers and the results are unioned (or merged). If you want to change this behavior you can also set this in Tools, Options under Query Results, SQL Server, Multiserver Results – “Merge Results” equals True. You can also set whether or not the login name is appended to the results (this defaults to false) in addition to whether or not the server name is appended (this defaults to true). You can change all three of these settings.

So, why did I make the status bar fuschia… what if I execute DROP DATABASE dbname… yes, it will try and drop this database from all servers in the group. While very powerful, this is something of which you should be careful.

OK, so here are the most interesting things about centralized management servers:

1) To designate a server as a CMS - that server must have an msdb. Originally, I thought that you couldn't use SQLExpress but because SQLExpress *does* have an msdb, this does work. However, SQLExpress lacks many other features/capabilities so outside of simplifying connectivity and query access, I'd probably target a higher edition of SQL Server. Even more specifically, if you're interested in where all of the server group information is stored:

Local Server Groups stored in: C:\Documents and Settings\<user>\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\RegSvr.xml

Centralized Management Server details are stored within the msdb in:

dbo.sysmanagement_shared_registered_servers_internal

dbo.sysmanagement_shared_server_groups_internal

2) Not only can you execute queries but you can right-click and choose Object Explorer and each server will be connected to and entered into your Object Explorer window. This will minimize your manually connecting/opening each server one by one.

3) AND, the servers can be servers other than SQL Server 2008... I've connected to 2005 and 2008 and you shouldn't have a problem adding any other SQL Servers - even 7.0...but, I haven't tried that (let me know if it works for 6.5 :).

3) Finally, in addition to executing queries, you can also Evaluate or Import Policies. This is something that can be really powerful. In addition to executing something directly, you can evaluate a policy against a number of servers in one step. Policy-Based Management is something that you'll start (if you haven't already) hearing a lot more about. And, since I'm always behind at blogging - check out these other links/blogs for more info on PBM:

Enjoy and thanks for reading,

kt

Categories:
SQL Server 2008

Well... I think I had had too much tea that morning ;-). But, as always, chatting with Richard and Greg was great. Here's the specific show link: http://www.runasradio.com/default.aspx?showNum=76.

Oh, and just for the record, I didn't come up with that title. But, I do hope that all your [high-priority and important] queries are indexed!

Enjoy!
kt

OK, I know this post doesn't really apply to most folks but I did want to have the setup instructions on my blog so that I could refer people to it. For the August release we updated all 17 labs and all of the demos for SQL Server 2008 RTM; however, we did use a "security enabled" VPC. And, well, security is bugging people right about now because the password policy in this VPC was set for 42 days. I know all of you run into this on production servers but on a test VPC, it's pretty much nothing more than an annoyance. So... I thought I'd mention how to disable it for the VPC.

(1)    Remove the policy for 42 password expiration

                Local Security Policy Editor (Admin Tools, Local Security Policy)

                Security Settings

                                Account Policies

                                                Password Policy

                                                                Set the Maximum password age to 0 days (which is no password expiration)

 

(2)    Change the SQLService account to not require a password on next login

Computer Management

                                Users and Groups

                                                SQLService

                                                                Deselect the option "User must change password at next login"

         you might not actually need to set this but it's good to check!

 

(3)    Windows Update

While you're at it then, you should also consider running Windows Update...

 

(4)    Shutdown and save changes...

And, here's the full instructions that we usually give out at conferences/workshops: SQL2008Aug HOLs DVD SETUP Instructions.pdf (25.93 KB)

As for accessing this content on the web, it's part of Jumpstart and it will be part of the SQL Server 2008 Resource Kit. Also, I just refreshed the image for the resource kit so that it does NOT have the password policy enabled so you won't need to do that step. Also, the Jumpstart folks will probably refresh the image there so that it also uses this version. Regardless, you might still want to run Windows Update. And, you'll also find a lot of these resources at upcoming events and conferences as well as through these resources.

Enjoy!
kt

I've tackled this type of question before but it's a very challenging thing to decide. Budgets are tight and training is always hard to quantify. However, working more efficiently and effectively - when properly trained - means smoother operations, less downtime, less data loss, less stress.

So, if you're looking for some ideas on training (conferences vs. traditional classes vs. "immersion events") then check out my post where I explain different events and different types of training here.

As for the most in-depth - and public event that Paul and I offer... it's coming up quickly in San Fran and I thought I'd do a quick post to get you some details.

San Francisco, CA - Oct 6-7-8, 2008
SQL Server 2008 Workshop for DBAs/ITPros (and even developers who just want to know more about how things work!). This is probably closest to an Immersion Event but it's great because we'll be doing lecture and hands-on (bring your own laptop) by handing out our newly updated 2008 Hands-on lab DVD (which has a 2008 RTM VPC on it that does't expire until 12/31/2009!). Here's a link to a detailed post that Paul did about the event here and click on the pic above to get to the site itself. This will be a relatively small and in-depth event where we get 2.5 days to cover a ton of new 2008 features (and general best practices/tips/tricks)!

Finally, Paul and I have been offline a bit recently as we've been out of the country - first, presenting in London, Dublin and Edinburgh and then attending Paul's sister's wedding in Scotland (and then celebrating my (yes, 29 [again!]) birthday with a sight-seeing trip around Skye). I think I need to do a post with a few pictures... Paul in a kilt springs to mind!

Happy September!
kt

Categories:
Events | SQL Server 2008

I first posted an update to sp_helpindex here. My version of sp_helpindex was solely to expand what sp_helpindex showed and adds 1 or 2 things based on version: for SQL2005+ it adds included columns and for SQL2008 it also adds the filter predicate. So, there were two versions of sp_helpindex2 depending on which verison you're using. A lot of folks like the changes to this sp but, alas, it had a bug (or two :) and in fact, I found a few others when I went back over this as well. So, thanks to Josh (who commented here) and to a private email (thanks Vasco!), I have an updated version of sp_helpindex2:

For SQL Server 2005, here's your new sp_helpindex2 script: sp_helpindex2_2005.zip (2.89 KB)

And, here's a simple test script for 2005:

DROP TABLE tbl1
GO

CREATE TABLE tbl1( c1 int, c2 int, c3 int, c4 int)
GO
CREATE INDEX ix_1 ON tbl1(c1) INCLUDE (c2)
CREATE INDEX ix_2 ON tbl1(c1)
CREATE INDEX ix_3 ON tbl1(c1) INCLUDE (c2, c3)
CREATE INDEX ix_4 ON tbl1(c1, c3) INCLUDE (c2)
CREATE INDEX ix_5 ON tbl1(c3) INCLUDE (c1, c2, c4)
CREATE INDEX ix_6 ON tbl1(c1, c2) INCLUDE (c3, c4)
go

sp_helpindex2 tbl1
go

index_name

index_description

index_keys

included_columns

ix_1

nonclustered located on fg1

c1

c2

ix_2

nonclustered located on fg1

c1

NULL

ix_3

nonclustered located on fg1

c1

c2, c3

ix_4

nonclustered located on fg1

c1, c3

c2

ix_5

nonclustered located on fg1

c3

c1, c2, c4

ix_6

nonclustered located on fg1

c1, c2

c3, c4

For SQL Server 2008, here's your new sp_helpindex2 script: sp_helpindex2_2008.zip (2.84 KB)

And, here's a simple test script for 2008:

DROP TABLE tbl1
GO

CREATE TABLE tbl1( c1 int, c2 int, c3 int, c4 int)
CREATE INDEX ix_1 ON tbl1(c1) INCLUDE (c2)
CREATE INDEX ix_2 ON tbl1(c1)
CREATE INDEX ix_3 ON tbl1(c1) INCLUDE (c2, c3)
CREATE INDEX ix_4 ON tbl1(c1, c3) INCLUDE (c2)
CREATE INDEX ix_5 ON tbl1(c3) INCLUDE (c1, c2, c4)
CREATE INDEX ix_6 ON tbl1(c1, c2) INCLUDE (c3, c4)

CREATE INDEX ix_1f ON tbl1(c1) INCLUDE (c2)
WHERE c3 IS NOT NULL

CREATE
INDEX ix_2f ON tbl1(c1)
WHERE c4 > 2

CREATE INDEX ix_3f ON tbl1(c1) INCLUDE (c2, c3)
WHERE c4 > 2 AND c1 < 50 AND c2 = 12

CREATE INDEX ix_4f ON tbl1(c1, c3) INCLUDE (c2)
WHERE c4 IS NOT NULL AND c1 = 12

CREATE INDEX ix_5f ON tbl1(c3) INCLUDE (c1, c2, c4)
WHERE c1 > 5

CREATE INDEX ix_6f ON tbl1(c1, c2) INCLUDE (c3, c4)
WHERE c4 < 20
go

sp_helpindex2 tbl1
go

index_name

index_description

index_keys

included_columns

filter_definition

ix_1

nonclustered located on PRIMARY

c1

c2

NULL

ix_1f

nonclustered located on PRIMARY

c1

c2

([c3] IS NOT NULL)

ix_2

nonclustered located on PRIMARY

c1

c2

NULL

ix_2f

nonclustered located on PRIMARY

c1

c2

([c4]>(2))

ix_3

nonclustered located on PRIMARY

c1

c2, c3

NULL

ix_3f

nonclustered located on PRIMARY

c1

c2, c3

([c4]>(2) AND [c1]<(50) AND [c2]=(12))

ix_4

nonclustered located on PRIMARY

c1, c3

c2

NULL

ix_4f

nonclustered located on PRIMARY

c1, c3

c2

([c4] IS NOT NULL AND [c1]=(12))

ix_5

nonclustered located on PRIMARY

c3

c1, c2, c4

NULL

ix_5f

nonclustered located on PRIMARY

c3

c1, c2, c4

([c1]>(5))

ix_6

nonclustered located on PRIMARY

c1, c2

c3, c4

NULL

ix_6f

nonclustered located on PRIMARY

c1, c2

c3, c4

([c4]<(20))

Have fun!
kt

YES!!!

OK, well, I guess I should be more specific because as in most things in SQL Server, the real answer is "it depends". And for these two options, it depends mostly on your SQL Server version. Since SQL Server 7.0, the way that auto update works, has changed (much so for the better!!). So, if you're in SQL Server 2005 or SQL Server 2008, I would say most definitely - leave these ON (or if you turned them off - turn them back on!!!)! If you still have problems with a specific index causing your grief, then turn off auto update at the index level NOT at the database level. To turn of auto update at the index level use STATISTICS_NORECOMPUTE in the index (or statistics) definition.

Now, as for why (and how!) this has changed over the versions... here we go:

SQL Server 7.0

  • Invalidation: Statistics were *invalidated* when a row modification counter (sysindexes.rowmodctr) was reached. This meant that they could not tell where the modifications were occuring and, if modifications were somewhat isolated to a specific column ALL of the statistics for the TABLE would be invalidated (so, statistics could be invalidated earlier than necessary)
  • Updating: Even worse, in SQL Server 7.0, when statistics were invalidated, they were immediately updated. This caused two problems - thrashing at the time of invalidation because all of the stats needed to be updated AND two, if the statistics were not used for awhile then extra work was involved to update them and by the time they were used, they might already be somewhat out of date already.

SQL Server 2000

  • Invalidation: Statistics were still invalidated based on a row modification counter.
  • Updating: SQL Server 2000 fixed the "updating-potentially-too-often" problem by only updating statistics when they were needed.

SQL Server 2005

  • Invalidation: The biggest changes were introduced in SQL Server 2005 where they decided to NO LONGER user the sysindexes.rowmodctr and instead use an internal (and undocumented) columns specific modification counter. Now, statistic invalidation is more isolated to only those columns which are heavily modified. This internal/undoc'ed column is sysrowsetcolumns.rcmodified and can only be seen when connecting to SQL Server using the DAC (Dedicated Admin Connection).
  • Updating: Updating didn't really change but, SQL Server 2005 added "Aynch Auto Update" for statistics so that when the QO (query optimizer) encounters an out-of-date (i.e. invalidated) statistic, they can "trigger" the update but not wait for the update (meaning that they'll optimize using the out-of-date statistic). This can be both positive (faster) and negative (might not be the best plan if the statistics have changed drastically). It is off by default and IMO, I'd leave it off in most cases but if you find that auto update events (which can be Profiled) are causing you grief, then you can turn this on at the database level.

SQL Server 2008

Nothing new except "Filtered Statistics" and these are interesting as the density vector is still relative to the table (not the predicate) but the histogram is just over the predicate (OK, I know I'll have to blog a lot more about this one!). Anyway, I'm still playing/learning a lot more about these and they make the most sense with filtered indexes (as opposed to just a filtered statistic) but, just like statistics on secondary columns you will also potentially want statistics on the secondary columns of your indexes. The next question is should they have a filter or not. I've found that sp_createstats doesn't seem to create statistics with filters and I'm going to need to do some testing here but I think statistics with filters (filters that match the non-clustered index) should help to make the stats better (and even allow better usage of filtered indexes) but, I'm really going to need a bunch of time with this - and another post :). As for auto create/auto update - no changes there!

Long story short, if you're using SQL Server 2005 or SQL Server 2008, you should leave auto create/auto update ON.

Thanks for reading!
kt

PS - A few of you have mailed me about a bug in the sp_helpindex2 script(s). OK, that's my next post!!! Possibly with an sp_helpstats2 script as well!

OK, so SQL Server 2008 came out *BEFORE* Visual Studio SP1 but VSSP1 was required (this was a bit annoying and created a lot of confusion/emails/newsgroup posts, etc.) but luckily VSSP1 came out only a couple of days after SQL Server 2008 RTM'ed. As for Data Dude, well, it's not RTM'ing until later this year (I think there will be one more release - probably an RC0 - before RTM) but they've been pushing out various CTPs... so, what works with what and how the heck do you get everything to install?? Oh my!

Really, it's very simple:

  1. Install Visual Studio 2008 (with Team System/Database Edition), then, install SP1
  2. Install SQL Server 2008
  3. Download/Install the latest Data Dude CTP. BOTH CTP15 and CTP16 work with SQL Server 2008 RTM but 16 has a lot of updates.

SQL/VS can really be installed in any order but this (above) is what was recommended as the best order. However, I've not heard any problems with SQL then VS. As for where to go to get more details on Data Dude - check out Gert's "Data Dude" blog for links to the downloads and a lot of tips/tricks.

Have fun!
kt

Categories:
SQL Server 2008 | Tips