How (not) to design a SQL Server table

I recently saw the worst example of  how not to design a table and indexes in SQL Server.

So here it is:


Role : Log any activity that a user is invited for.

PrimaryKey: … Wait for it … tada : UserID,ActivityID,ActivityType,AddDate … Wait you say …. YES … all table columns are used for the primary key and of course by default this will be a clustered index. Which means that if you want to insert 100K records in this table … it will split a lot of pages to reorganize the index beside actually adding the table records.

Wait … it gets better…

Someone created a non clustered index on ActivityID,UserID,,ActivityType,AddDate … yes in that order … and NO it does not help but I guess not everybody knows that a non clustered index will contain the clustered index besides the actual index.

So let’s recap:

Table : 4 Columns

PK Clustered Index: Same 4 Columns

Non clustered index: Same 4 columns x2

Insert efficiency -> extremely poor.

Where did Microsoft Zune coders failed? or It’s a feature!!!

Eduard gives us the following  problem:

The result is that  every 4 years for a day you realized the money spent on a Zune are wasted

Now for the Microsoft solution (Please refrain from ROTFL :-D! ):

Follow these steps:

  1. Disconnect your Zune from USB and AC power sources.
  2. Because the player is frozen, its battery will drain—this is good. Wait until the battery is empty and the screen goes black. If the battery was fully charged, this might take a couple of hours.
  3. Wait until after noon GMT on January 1, 2009 (that’s 7 a.m. Eastern or 4 a.m. Pacific time).

It’s here!!!

Finally here, my new DSLR  Nikon D40 outfitted with a  18-135mm lens
So far I’m extremely happy with it and I still believe I mad the right decision choosing this over Canon Digital Rebel XT.
I must confess that I always loved the quality of Nikon Lenses.

Still trying to figure out all the function and in RTFM mode.

Ski Wilmot

Tuesday I went skiing at Wilmot. It’s 25 miles from my home right on the IL/WI state line and it seemed like a cool idea to start the new year. And cool it was …   -15F/-26C to be exact with strong winds but after getting a Seirus ski mask from the local ski shop I survived the cold and had a good time on the practically empty slopes

    Yesterday I got a pair of  Bolle Nova that I’ll try the next time.

    Let’s start

    And this is how I started … thinking that some ideas that went through my head are not completely stupid and maybe somebody will actually take the time to read/appreciate them

    So one of my resolutions for 2008 is to have my own blog …  DONE
    This being the easy part … let’s see how I’m going to cope with my writing and most important thing: Will it actually be interesting?

    So I’ll let time be the judge.