Tuesday, October 23, 2007

My favorite Apple Leopard Features

Ahh it wouldn't be a good day if I didn't get to poke a bit of fun at Apple. Just going through the list of features gives me tons of reasons to upgrade

Boot Camp
Can't I download this for free as-is?

Desktop
"Enjoy an elegant, distinctive new look across the entire system. The semitransparent menu bar and reflective Dock frame your desktop picture. The active application window stands out with a deeper drop shadow and a distinctive toolbar color. One look at Leopard and you’ll know you’re in for something special."

Or I could just run Vista...

DVD Player
"Enjoy DVD Player’s dramatic new full-screen interface, which puts all your DVD’s features right at your fingertips. Mouse over the top or bottom regions to access onscreen semitransparent displays for a wealth of controls and settings."

Yes, truly groundbreaking...

Security
Firewall
"Gain more control over the built-in firewall. Specify the behavior of specific applications to either allow or block incoming connections."

Ya thats original

Library Randomization
"Defend against attackers with no effort at all. One of the most common security breaches occurs when a hacker’s code calls a known memory address to have a system function execute malicious code. Leopard frustrates this plan by relocating system libraries to one of several thousand possible randomly assigned addresses."

Apple: "We invented it first, then MS copied it!"

"Stronger Encryption for Disk Images
Give your data even more security. Disk Utility now allows you to create encrypted disk images using 256-bit AES encryption."

Can anyone say Windows 2000?

System
"Empty Trash Button
Empty the Trash from the Trash itself with the Empty Trash button."

My life will never be the same

Time Machine
Good thing Windows users haven't been enjoying this since Windows 2003.

Unix
"64-Bit Applications
Make use of all your existing devices. Leopard is the first mainstream operating system to completely and seamlessly support both 32-bit and 64-bit applications on the same platform."

Yes Apple, you are the first system to seamlessly support both 32-bit and 64-bit. Wait, then what I have I been running on my Windows machine for the last 2 years?

Xcode3
"Easily visualize your code's structure as you type with a unique highlighting effect, or use your mouse to select a code block to fold out of the way"

Once again Apple, you have raised the bar.....to Visual Studio 2003.


So all in all, there are 10 new real features?

Wednesday, October 17, 2007

New Blackberry firmware coming down the pipe?

My partner alerted me today to the fact that RIM has finally released 4.2 code for the 8700. I complained a while back that the 8800 code was buggy and in desperate need of an update - I can only hope that this is a sign of things to come!

Wednesday, October 10, 2007

Watch your Fill Factor

I was asked to troubleshoot an issue today with a 3rd party web application that was throwing some SQL Timeout exceptions while attempting to insert data into a database.

With the exception of long running queries, most timeout errors are caused by a few issues:

  • Runaway transaction logs
  • High fill factors
  • Missing clustered indexes

While I could probably write entire articles on each of these, I'm going to concentrate on the fill factors.

First, it's important to know that SQL Server itself does not have any timeouts; rather timeouts are implemented by the data provider (the .NET SQL providers) or the client (query analyzer, etc).

So what exactly is the fill factor? The fill factor is a parameter you set on indexes (both clustered and non-clustered); it controls the percentge of free space to leave on each page to leave room for future growth. Lower fill factors leads to less page splits. So why is this important? Well, page splits are expensive - they take a lot of CPU and disk resources to complete. So if you have a busy DB (lots of inserts into a table), and a high fill factor, then SQL server will have to constantly split pages to accomodate the growth, which might take longer then your timeout, resulting in a timeout error!

According to MSDN documentation (http://msdn2.microsoft.com/en-us/library/aa933139(SQL.80).aspx):

"Fill factor value is a percentage from 0 to 100 that specifies how much to fill the data pages after the index is created. A value of 100 means the pages will be full and will take the least amount of storage space. This setting should be used only when there will be no changes to the data, for example, on a read-only table. A lower value leaves more empty space on the data pages, which reduces the need to split data pages as indexes grow but requires more storage space. This setting is more appropriate when there will be changes to the data in the table."

In my particular case, I was able to resolve the timeout issue by changing the fill factor from 90% to 40%. Why 40% you might ask? The customer did not have overly large amounts of storage and decreasing the fill factor increases storage requirements - I could have set this to 0 but I didn't want to have an out-of-space condition to deal with, so 40% seemed reasonable to me.

Setting the fill factor via script is relatively easy and involves dropping the constraint and re-adding it with the new fill factor.

ALTER TABLE dbo.MyTableName
DROP CONSTRAINT PK_MyTableName
GO
ALTER TABLE dbo.MyTableName ADD CONSTRAINT
PK_MyTableName PRIMARY KEY CLUSTERED (
MyTableNameID
) WITH FILLFACTOR = 40 ON [PRIMARY]

Just something to watch out for when designing your DB's!