January 23, 2013 9:00 AM
Posted by: Denny Cherry
, Execution Plans
, SELECT statement
, SQL Server
All to often when talking to developers they put the WITH (NOLOCK) table hint in place to speed up queries without understanding what the table hint does. I’ve even run across companies that have policies in place that every select statement must have the WITH (NOLOCK) table hint.
The WITH (NOLOCK) table hint isn’t a go faster button for SQL Server. It has actual implications to the data which is being returned by the query. The biggest of these implications is that the data might not be correct. You see the WITH (NOLOCK) table hint uses dirty reads to return the data, so it basically ignores the locks which other queries have taken. This is why the query appears to run faster, because the query isn’t being blocked any more. The proper approach would be to find the query which is causing the extended blocking and figure out why it is taking so long to run, and fix the performance problems of that query.
The only go faster button that is available in SQL Server is the CREATE INDEX statement. Anything else isn’t truly a go faster button, and has other side effects which must be understood before being implemented.
January 9, 2013 9:00 AM
Posted by: Denny Cherry
, Delta Airlines
, Hilton Hotels
, SQL Server
, United Airlines
Every once in a while I put down a few notes designed to help out the new frequent fliers among us. Traveling a lot sucks there is just no getting around that. You are always away from home, you miss your family, and they miss you. You don’t have much of your stuff, and finding the stuff that you are missing can be a pain if you don’t know the city (or if you don’t speak the language). But there are a few things that you can do to make life easier and more comfortable for yourself and your family on the road.
Pick an airline, rental car company and hotel chain and do your best to stick with them. It doesn’t really matter which one you pick, and everyone has their favorites for one reason or another. In my case I’m a Hilton guy for hotels, a United guy for flights and an Avis guy for car rentals. I’m signed up for all three of their loyalty programs so I earn points each time I use their services. In fact Avis and Hilton even offer bonus programs so that I can earn extra United miles each time I stay at a Hilton or rent a car from Avis.
In addition to earning points and miles you get something more important from being members of these programs, upgrades. Now don’t get your hopes up that you’ll be flying first class every time you book a coach ticket on an airline just because you signed up for their loyalty program. Free upgrades require having status with the airline, and who ever has the highest status gets the upgrades first. In the case of United there are four levels, Silver which requires 25k miles of travel, gold which requires 50k miles of travel, platinum which requires 75k miles of travel and “1k” which requires 100k miles of travel. Now these free upgrades for the most part are only good on flights within the US on the airline of your choice and their partner airlines. So before you pick an airline do a little research on what the flight options are from your home airport and what partners they have and how the flights to where you will usually be traveling will work.
With car rental companies you get some nice bonuses just for joining their programs, usually free upgrades with a minimum rental level, skipping the counter, etc. For example with Avis just for joining the program if you rent an intermediate class car or above if there is something nicer available they will automatically assign you that car as a rental for free. Some upgrades that I’ve been given before include: Prius, Chrysler 300 M, Mustang, and Camaros just to name a few.
Another great way to earn status is to get an airline or hotel credit card. If you can get qualified for some of the higher end credit cards you can get some really nice perks. Now these cards aren’t free, but if you use the perks to your advantage they can be worth every penny. An airline’s higher level card such as the United Mileage Plus Explorer card gets you on the plane earlier (even if you don’t have status to get on earlier yet), a free checked bag and two passes into the United club lounge. Plus you earn frequent flier mile for every dollar that you spend using the card. There’s actually a card which is above the Mileage Plus Explorer card called the United Club card, which is the one that I’ve got. This card gives you all the access to the club lounge you can use, bonus miles when paying for air travel, platinum status at Hyatt, presidents club service at Avis (so double class upgrades on rentals), plus all sorts of other really useful perks like free travel insurance, buyers protection for anything you buy, etc.
With the hotel programs once you stay enough nights (the number of nights per level will vary depending on which hotel chain that you use) you’ll start getting room upgrades for your hotel rooms as well. Free upgrades to the club or executive level, free WiFi, free breakfast, etc.
The other nice thing about all these loyalty programs is that you are racking up all these points on business trips you can use these points to take yourself and the family on some pretty nice vacations for free or next to free. I can use my United points to not only pay for flights on United and their partner airlines, but I can also use my United points to pay for hotels, rental cars, etc. Now don’t just use the points, look to see what the rentals will actually cost you because it might be worth paying cash for some stuff.
Keep In Touch
Call home, daily. Now I know that work schedules and time zones may not permit long phone calls home on a regular basis, but a few minutes when you can helps out a lot. I always make a point of calling when I’ve landed in my destination city. I usually wait until after I’ve gotten to my rental car and figured out where I’m going (usually using my phone as my GPS). Skype is great for this because you can not only talk to each other, but you can see each other as well. If you have a long trip where you are away for a couple of weeks this can be great so that the people at home can remember what you actually look like. Of course things like Apple’s Face Time work great for this as well.
Bring Stuff Home
When you get home from somewhere, especially somewhere that you’ve never been before make sure that you bring back something besides dirty laundry. You’ll want to make sure that you bring back something to show the family that you’ve been thinking about them. Try to avoid the crap in the airport if you can (granted some airports have some pretty nice stuff). Don’t forget when packing to leave room in your bags to bring stuff home for the family, especially if you are going somewhere that your spouse would want to go but can’t.
Take The Family With You
If you are going somewhere really cool, try and take the family (or at least the spouse) with you on the trip. Add a few extra days onto one end or the other of the trip to do some sight seeing and explore where you are. Especially if you are going somewhere really cool like another country that either one of you have ever been to. Thanks to my travels I’ve been lucky enough to take Kris (my wife) to Amsterdam (twice), Belgium, and London so far. Later this year when we go back to Belgium and Amsterdam we are planning on going to Paris as well so that we can go somewhere new as well to places that we already love. The biggest expense (at least for Americans flying to places like Europe) is the flight cost, a few extra nights in the hotel really isn’t all that expensive. Book the flights carefully, maybe booking the spouses flight using some miles to keep that cost down.
When flying with the family, especially within the states when you have status with the airlines and there’s a chance that you’ll get an upgrade, make sure to book every ones tickets together on the same purchase. The reason for this is that if you do get an upgrade, the airline will also upgrade one of the other people in your party so your spouse can also get an upgrade to first class with you.
Use The Down Time
When you are traveling there is lots of down time which can really suck if you’ve got a lot of stuff to do. Many airports have WiFi available for free or for a small charge. If you often travel via airports that charge for WiFi look into a Boingo Account. Boingo either provides WiFi for most airports that do charge, or they are partnered with the airports that charge for WiFi. If you are often at these airports a monthly Boingo account will probably end up being cheaper than paying for daily access at the airports. If you sign up for the airlines club lounge they will usually provide you with free WiFi so that you can get online from within the club lounge.
When you get to the airport find yourself a nice place to settle down and work. This way you can use the down time during layovers or while you are waiting at the airports to catch up on email, projects, meetings, etc. Personally I like to work on writing for my blog, or the next article that I have due. On some flights you can get WiFi for just a few dollars a flight so that you can get online during your flight as well. Again if you fly often paying for a monthly account will probably be cheaper than paying for access on each flight. Currently Delta has the best WiFi service available. United doesn’t currently offer WiFi on many if any flights, but they are working on rolling out WiFi to the majority of their fleet (or at least that’s what the video before the safety video keeps telling me). Even some international flights between the US and Europe offer WiFi on the flight so you can stay connected on those long haul flights as well.
Now the speed on the in flight WiFi isn’t the greatest, but it’s fast enough to VPN into a client’s network and do some work, send and receive email, or even burn a little time on Twitter, though I wouldn’t try playing any games on Facebook over the WiFi.
One of the most important things that you’ll learn is to pack light. Take only what you need for the trip that you are on otherwise you are just lugging stuff around the airport for no reason. As you get used to packing you’ll be able to get more and more stuff into smaller and smaller bags. Personally I’m able to do a 9 day trip in a single roller bag and my laptop bag. Speaking of roller bags the right sized bag is very important. You want a narrow bag that tapers to a smaller end at the top so that it’ll fit in those funny shaped overhead bins that the A319s and smaller 737s have.
When you select the clothing that will be taking, try to take clothes make from materials that are light and that don’t wrinkle easily. When packing don’t be to worried about things getting a little wrinkled. That is going to happen no matter how careful you are. I’ve taken garment bags or roller bags, and everything gets wrinkled about the same. 99% of hotels have an iron in them if you are so inclined. If you are like me and hate ironing hang the clothes in the bathroom, probably off the hook on the back of the door, and turn on the shower to hot. This will steam up the room and get most of the wrinkles out of the clothes. It’ll only take 5-10 minutes in the steam. Then take them and hang them in the room or the closet with plenty of room to breath so that they can dry completely as they may be a bit damp. If they are wet you left them in there way to long.
If you need to wash something, there’s a cleaning service in most hotels but it is going to be pretty expensive. You can usually find a self service room with a washer and a drier in it that you can use. A full load in the washer and drier will usually cost you a couple of dollars. If you only need to wash a shirt or something like that using the hotel room sink will usually work pretty well. After you wash it, lay a towel on the floor and put the shirt you just washed on top of the towel. Roll it up loosely into a roll, then stand on it to squeeze the water out of the shirt. The towel will absorb most of the water. Then you can hang dry the item in the room (not in the closet as it won’t get enough air flow in there). If you need to wash a few things using this technique just ask house keeping for a few extra towels. They’ll be happy to deliver these to you. Most hotel shampoo will make a decent enough clothing wash as it’s usually pretty mild. Just put it in the water so that it mixes well before putting the clothing into the sink.
Managing receipts for work or for a client is probably the worst part of traveling. Some companies want every single receipt, even all the $1 charges on the toll roads while others want just the big ones as they’ll trust you on all the small stuff. What I do, which works pretty well for me is I grab a standard size envelope before I leave home, or from the hotel when I check in. All my receipts go into that envelope at the end of each day of the trip. As I’m on the road all the time I also make sure to write the name of the trip, or the destination, as well as the dates on it as often I’ll have two or three of these envelopes in my bag by the end of a long trip. My laptop bag has side pockets that are the perfect size for these envelopes to stick out of. Just make sure that the envelopes fit snugly in there so that they don’t fall out. Personally I put my airline boarding passes in there after my flights as well. Just in case the airline doesn’t credit me correctly for my miles flown. Sometimes they’ll want the actual boarding pass if you had a paper boarding pass.
Having everything in these envelopes does a couple of things for me. It makes expense reports and invoices much easier to deal with as everything is already sorted (I make sure that flight receipts from when I purchase the airline tickets go in these envelopes as well). Secondly it makes tax season much easier as everything is already broken down by trip already, so anything that I need to deduct I can quickly figure out. If you are so inclined you could even write on the envelope a summary of the receipts in it to make tax season that much faster. Then instead of giving the accountant a huge box of receipts to figure out, they (or you if you do your own taxes) just have to flip through the envelopes to figure everything out.
Hopefully you were able to get some useful information from this, weather you are a first time traveler or a frequent flier like myself. The one thing that I’ve learned when traveling is that there isn’t any one way to travel correctly and easily. The trick is to find things that work for you best and then keep doing them. Consistency is the key to making travel easy.
January 2, 2013 2:00 PM
Posted by: Denny Cherry
, Social Commentary
, SQL Server
Welcome my friends to the first official work day of the year 2013. You enjoying that hangover yet?
It is time again to take a little peak at the last year (as far as my blog goes) and see just what was the most popular posts, and what just sucked so that hopefully for this year I can do better. (Sadly do to come reporting issues I don’t have all the data for 2012. I’m missing a chunk in the middle for a few months, so the numbers are actually higher than they are, but I’ll just have to work with the data that I have.)
The posts that were read the most in 2012 were…
10. Single Instance vs. Multiple Instances - 4.4k views
9. Back to Basics: The BACKUP DATABASE command - 5.4k views
8. New INSERT syntax in SQL Server 2008 - 5.9k views
7. SQL Server 2012 Licensing Changes - 7.6k views
6. Difference between an Index and a Primary Key - 8.7k views
5. What exactly is MSDTC, any when do I need it? - 11.5k views
4. Upgrading Windows 8 RP to RTM - 11.6k views
3. Back To Basics: The UPDATE Statement - 14.7k views
2. How to configure DTC on Windows 2008 - 18.5k views
1. Back To Basics: Clustered vs NonClustered Indexes; what’s the difference? - 24.1k views
This gives some interesting insight into what people are reading off on my blog. If you compare to last years top 10 blog posts you see that it is a lot of the same blog posts. In fact of the top 10, only 2 are different from 2011 to 2012.
#1 – How To Configure DTC on Windows 2008
#2 – Back To Basics: The Update Statement
#3 – Back To Basics: Clustered vs. NonClustered Indexes
#4 – What Exactly Is MSDTC And When Do I Need It
#5 – New Insert Syntax in SQL Server 2008
#6 – Difference Between an Index And a Primary Key
#7 – SQL Server 2012 Licensing Changes
#8 – If You Aren’t Doing Backups You Aren’t Doing Your Job
#9 – Single Instance vs. Multiple Instance
#10 – You Can’t Deploy A SQL 2008 SSRS Report to a SQL 2005 SSRS Server
In both my 2012 top posts and my 2011 top posts only 2 are different. And only one of the two new posts from the 2012 list were written in 2012. The one written in 2012 is about upgrading the Windows 8 RP to RTM and was cross posted all over the place. The second new entry to the top 10 list is in the #10 spot and was actually written back in 2008, but the topic is an oldie but a goodie … database backups.
So back to the insight that this gives me. I find it interesting that so many people viewed my posts on configuring MS DTC (there are two on the list). There is also a lot of intro level material on that top 10 list from 2012 as well which means that in addition to writing about complex topics the more intro level stuff is definitely stuff that lots of people are interested in.
Hopefully you’ll keep reading my blog though 2013 (as beyond).
Have a great new year,