Saturday, October 25, 2008

I like, like

Let’s say you have a database with over 100,000 records. And you want to pull up one particular record. Going through them one by one would not be good for your mental health. The easiest approach would be to search by primary key. But suppose the primary key is made up of 25 digits. Do you really want to type in that many numbers when writing your search query? Most likely not.

When I faced this situation I spent a lot time typing in numbers. With deadlines looming I found that this approach was not practical. That’s when I came across the “like” command. It let me search by only a portion of the primary key. Which means I only had to remember the first few digits of the key to get me going. Which was very convenient. (I am sure there are hard core DBAs out there who have better ways of doing this, do share)

That also raises the question of how people deal with pressure. Some would give up, which is a real shame. Others would keep at it and try to make it. This is when the pressure turns out to be good for you as it makes you better. It’s the old adage of the diamond in the rough.
Post a Comment