Friday, October 07, 2005

Speaking at VS Live

Well, this one hit me out of the blue. I have been asked to speak at the Sydney VS Live conference on SQL Server Express.

My fellow colleague Greg Low dobbed me in for this one, he made the assumption that because I've been working on a commercial project with SQL Server Express since January of this year, I might actually know something about it.

It's all very exciting, but I'm a bit nervous about it all, I haven't done any public speaking for quite some time now. I have a few ideas on what I want to talk about, but I'd love some feedback as to what other people want to hear about SQL Server Express.

DB Performance tip

Normally when I think of DB Performance, I usually concerntrate on indexes, query structure, etc... all of which are quite important, but I have started listening to an msdn web cast series called "A Primer to Proper Sql Server Development" by Kimberly Trip, and in the very first episode was able to find the answer to a performance issue that had been puzzling me and the developers I'm currently working with for some months now.

The problem was that our application that is using SQL Express was having some serious performance issues. It was slow to start up, it took ages to save to the database the first few times, but then things seem to pick up a little, but not quite as much as would be ideal. Any one want to guess what the problem was????? I know all you SQL Server guru's out there have it already, but for the benefit of those who don't.... pre-allocating the size of the log file fixed the problem quite nicely.

We were already pre-allocating the size of our primary datafile to 4MB, so when we used the CREATE DATABASE ... FOR ATATCH statement, the logfile would be created by default at 25% the size of the primary datafile.... 500KB. The application is very database intensive, and filled up the log file very very quickly, and by default, the logfile would auto grow by 10% of it's original size... which would fill up very quickly again, and then auto grow by another 10% etc.... Of course this growing of the log file is quite costly, and we found that by setting the log file to be 4MB by default, with a 4MB file growth, we were able to achieve quite a significant improvement. We cut the initial loading by half, and the first few saves are now instantaneous.

If your working with SQL Server, then I'd highly recommend the web case series, there are lots of other useful tips and hints.