Author Archive
SQL Moment of Clairity
Posted by: darren in SQL Origami on October 17th, 2006
I was working on a stored procedure the other day, not one that I wrote originally but one that was causing performance issues in out system. The procedure was taking any where from 40 to 60 seconds to run, which is unacceptable in a web service. This in fact was causing the web service to time out.
An inspection of the execution plan showed that one part of the procedure was doing an index scan and that it was this that was taking up over 85% of the execution time. I was totally baffled, it was hitting the index so why wasn’t it faster?
Then I learned three things all at once:
- Implicit Conversion
- non-sargable kills performance
- Index Seek is preferred of Index Scan
Implicit Conversion
In the stored proc a variable was defined as an NVARCHAR(20) but the field in the table it was being compared to was a CHAR(10). This lead to an implicit conversion of the variable to a CHAR(10), which lead into the next issue:
Non-Sargable Kills Performance
Sargable refers to the pseudo-acronym “SARG” – Search ARGument and refers to a WHERE clause that compares a constant value to a column value. The implicit conversion was causing a non-SARGable condition which means the WHERE clause cannot use an index.
Index Scan
Because of the non-sargable condition an Index Scan was being performed. An Index Scan is just as bad as a Table Scan in the SQL realm and should be avoided at all costs.
The solution was simple: Change the variable to a CHAR(10). After doing that the Index Scan became an Index Seek and the whole stored procedure returned in less than a second. Any time I see an order of magnitude improvement like that from one simple change it just boggles my mind.
Ralf’s Sudelbücher : .NET naked – See these hitherto unpublished pictures of the .NET Framework architecture
The other day, though, I stumbled over yet another software quality assessment tool: Lattix LDM. And what impressed me immediately was it´s easy to understand output based on the intuitive concept of the Dependency Structure Matrix (DSM).
Ralf demonstrates how a Dependency Structure Matrix can reveal the overall architecture quality of a product. A very cool concept and another tool to add to the toolbox.
Craig: I want to Win a Free Book!
Craig Shoemaker over at The Polymorphic Podcast is giving away a free book.
Note to Craig: Pick Me! Pick Me!
I have been listening to Craig since he started his podcast and have been thourhly impressed with the show. He always has some good info and does not come across as being self important. He sounds like a humble programmer who is working hard and trying to give back to the community that he works in. When he interviews other people he basically gives them the floor and lets the guest do most of the talking, which is very nice.
Currently I only religously listen to three podcasts: Hanselminutes, Ockham’s Razor and The Polymorphic Podcast.
So Craig, keep up the good work. Oh, and Pick Me!
Cisco VPN Sucks
I have to use the Cisco VPN Client at work and man when it breaks it breaks good! For some reason it has decided to stop working which means I can’t work at home. Now I have to spend my Saterday morning in the office. CRAP!
I’ve been looking for an alternative but can’t seem to find one. If anyone knows of a good alternative please let me know.
.5 TB Server
While rebuilding our home file server I realized that I had about .5 TB of disk space. This is spread across four different sized harddrives but if you add up the total space it is over 600 GB. It is not the full Terabyte server that I’ve been wanting to build but it is a step in that direction.
And I’m not doing any RAID. I will be doing rsync snapshot backups to one of the harddrives so I am loosing already half my space. When I get enough $$$ I will get more drives and attempt some RAID or Linux LVM.
I am using Ubuntu on the machine. I started down the road of using straight Debian but soon got real tired of trying to figure out how to make things work. With Ubuntu I would say that 80 to 90% of my hardware problems went away and I didn’t have to hunt down any drivers or figure out why I couldn’t get a higher screen resolution. My last file server I used Gentoo which rocks, by the way, but I have gotten to the point where I don’t want to spend days just setting up the OS. As it is it has taken me a while and multiple installs of Ubuntu just to get the server into a state that I like it.
Next is setting up a Subversion instance on the machine. It would be a great thing to have my own SVN server that I can get to when ever I need. After that I need to clean up my tech library.
It just never ends.
G-Ding.TV | Viewing Linux in a whole new way
Welcome to G-Ding.TV, home of MythDora. MythDora is a Fedora Core and MythTV “All-In-One” CD. The CD will load a preconfigured Fedora Core 4 installation on your computer as well as install and configure MythTV-0.19. There are extras included with MythDora such as MythBurn, MediaMVP and MythStreamTV for some extra fun. Enjoy!
G-Ding.TV | Viewing Linux in a whole new way.
Looks like I have a weekend project to get started on.
Outlook Rules + Blackberry == SUCKS
I just got a Blackberry for work and am having a hard time dealing with it. I didn’t ask for it but if I have to use it I will.
The real problem I am having is the clash of Outlook rules and my use of folders to organize email’s. Because the email’s I get are moved into a folder (me being the anal organizational type) they do not get forwarded to the Blackberry. This sucks because I don’t get all my email’s which defeats the purpose of having the thing.
I have a plan to solve the problem. A guy I work with says that he does not use folders to organize his email’s, just sorts them in the Inbox. On Hanselminutes Carl Franklin said that he leaves everything in the Inbox and uses a Desktop search tool. I am thinking that a combination of these two practices and using the Favorite Folders in Outlook would work as well. That way I can remove all my rules, have everything stay in the Inbox and at some later date I can organize as I see fit.
Its going to really hurt getting ride of the rules though. I like my rules.
Aggragator Sites
I just found a few aggragator sites that look cool. Of course I found them thourgh a Digg.com post.
So when you want to see what the latest buzz is but don’t want to visit ALL the social sites, check out the aggragators.
Building a build server with CC.NET
So I have started implementing CruiseControl.Net at work and I have to say it is pretty fun. I’ve built a bunch on Nant scripts to build our SOA middle tier, installed CC.Net and setup the first project.
What I am struggling with now is getting VSS to update the source files. I think I am just missing something small but for some reason I can’t get the files to update.
Update
I finally had to create NAnt scripts to update the actual source. The VSS task in CC.Net only monitors the VSS DB for changes, it does not actually down load the latest source. At least as far as I could tell it does not.
Next is to get the VSS labeled. CC.Net will label the source but it is not descriptive enough so it will be a trip back to the NAnt scripts.
Hanselminutes – Not Franklinminutes
I like listening to Scott Hanselmin on Hanselminutes. I first noticed Scott while listening to .Net Rocks, the Podcast that was around before the term Podcast. Scott always knows all the cool tools, the most informative websites and alternative ways (read: Not .NET) ways of doing things. His show is great.
But then there is Carl. Let’s not forget that Hanselminutes is Hosted by Carl Franklin. Carl sounds like the Java guy I work with; every time Scott brings up something that is not Microsoft or .Net Carl always comes back with “.NET can do that…”. Or more precisely, “VB.Net can do that.” Drives me nuts.
Like in the show about Dynamic vs Compiled Languages Scott was making the point that TDD could take the place of a compiler in making sure your code was working. Carl argued relentlessly that there was no way you were going to get developers to use TDD. In my opinion Carl is missing the picture.
Note to Carl: Let Scott have his Minutes.
Coding Horror: Source Control: Anything But SourceSafe
If you are serious about the practice of software development, you should avoid SourceSafe.
SourceSafe poisons the minds of software developers.
Coding Horror: Source Control: Anything But SourceSafe.
Visual Source Safe sucks. Jeff Atwood explains in no uncertain terms why it sucks and I just want to get my vote in. The two most important issues he points out is that VSS gives the illusion of safety and VSS users DON’T BRANCH!
They fear branching because it takes so much time and it is just a foreign concept to them.
Do yourself a favor, get a real tool. Be a real programmer.
Programming with Interfaces
Today I was told that:
In general, interfaces should be used sparingly as they add unneeded complexity when applied to a simple set of objects.
I don’t get it, I thought interfaces were a Good Thing. I must be missing something….
YouTube – The future of TV
I have been saying for the last couple of years that once we get true TV on demand we will stop becoming slaves to the networks. YouTube and Google Video are the start of that phenomena.
The thing I just found out about YouTube is that you can embed videos in any post and not worry about actaully hosting the video. See my post on the Blue Man Group for an example.
Gallery Upgrade
I upgraded my Gallery from 1.5 to 2.1 and man am I freaking impressed! Between WordPress and Gallery the stuff I’ve been working on with ASP.NET look like total crap.
The upgrade process was really easy. Rename my original gallery folder, make sure it still works, install the new gallery, import the old. The new Gallery uses MySql where as the 1.5 version only used folders to manage the albums.
Overall the experience with working with the 2.1 version is great. There is a new admin interface and just a quick look at the plug-ins shows that there is a way to upload images from Picasso! That Freaking Rocks!
Moving blogs, ASP.NET vs PHP and WordPress
I moved my permanent blog to here, if you hadn’t noticed. It went a whole lot smoother than I thought it would as my main blog was on Blogger.com. I had this sinking feeling that in order to move all my entries I would have to save them one by one then repost them. Boy was I surprised!
I had originally given thought to switching my hosting to use ASP.Net, the only hold back was that my gallery was using Gallery. But since I am a .NET developer I thought “why not use something I know?” Wrong attitude! It would cost me more to use a .Net server plus after looking around there were not a whole lot of options when it came to applications. There is DotNetNuke, dasBlog or SubText, plus a handful of galleries. From what I saw none of those approach the maturity of the PHP options.
I settled on WordPress mainly because I have used it before. I’ve used numerous CMS applications but I do not want a CMS. I want a blog engine and a gallery. The hosting company provided Gallery already which I use and like, and it does offer PHPNuke but that would not fit my needs.
So how to handle the migration? Turns out that is all built into WordPress. When I saw that I could import my entire Blogger site I was amazed! The whole installation process was simple and enjoyable. The migration took all of fifteen minutes and that is only because I had to figure out how to dump the two blog entries I had at LiveJournal.
Why did I leave blogger? I am a adamant fan of almost every thing Google and I have had that blog for ages, but I felt like I had to fight the system more than I needed to. If I wanted categories I would have to either create separate blogs or encode the titles then have some funky search going on. I think the one thing that really made me want to switch was that I could not select individual entries. How lame is that?
But I am here now. My own domain. My own little space in the wild.
Moving …
This blog has been moved to http://blog.ddpruitt.net
Not that anyone actually reads this blog but just to let you know.
VMWare Server – Good but…
I’ve have discovered virtualization. Actually I started using it several months ago and found that it is GREAT! It Rocks My World!!
After trying Microsoft’s I decided that I preferred VMWare’s Virtual Server, mainly because there is a version for Linux. I have a plan to build the ultimate home server using VM’s.
However, tonight I had just downloaded the SourceForge Enterprise VM and was going to play with it but my license key for VMWare Virtual Server had expired. When I tried to get a new one their server returned a nice little Tomcat error:
javax.servlet.ServletException: JesapiFilter: Invalid Remote Address.
That sucks because now I have to uninstall the server and install the VMPlayer. blah. But, it is all free so who am I to complan.
VMWare Server – Good but…
I’ve have discovered virtualization. Actually I started using it several months ago and found that it is GREAT! It Rocks My World!!
After trying Microsoft’s I decided that I preferred VMWare’s Virtual Server, mainly because there is a version for Linux. I have a plan to build the ultimate home server using VM’s.
However, tonight I had just downloaded the SourceForge Enterprise VM and was going to play with it but my license key for VMWare Virtual Server had expired. When I tried to get a new one their server returned a nice little Tomcat error:
javax.servlet.ServletException: JesapiFilter: Invalid Remote Address.
That sucks because now I have to uninstall the server and install the VMPlayer. blah. But, it is all free so who am I to complan.

