How Expensive is a WHERE Clause?

The MySQL Performance Blog today addresses that question, and it’s an interesting analysis.  However, as the thrust of the blog is with performance, and typically with a view to real world impact, anyone reading this article needs to pay very close attention to the last paragraph:

It would be interesting, in an academic kind of way, to test different data types and various complexities of WHERE clauses, but I’m not really interested enough to spend much time on it. I just wondered whether the WHERE clause would even be noticeable.  This test doesn’t really reveal anything you can do to make your queries faster—you usually can’t optimize the WHERE clause itself, only the way that the MySQL optimizer chooses to apply the clause to indexes.

I bring it up because I just know that I will get at least one suggestion from someone who stumbles on this article that we remove the WHERE clauses from a number of queries and just let PHP wholly manage the data.  So let me be proactive and react to that inevitable suggestion: ludicrous.  Not only would you easily exceed your host’s memory limit for your PHP environment, but PHP is not particularly a sprinter when it comes to filtering and sorting large data sets.  The WHERE clause is not wasteful, it’s MySQL doing its job.

Unless you’re one of the MySQL developers looking to increase server performance in your product, this type of benchmarking is worthless.  PHP developers do the same thing though, and I’ve certainly been guilty of it.  I guess it’s the geek in all of us that harkens back to our days as children where we took everything apart to see how it worked.  It’s fun, but don’t let it become a distraction to your development and implementation, whether you’re a developer writing code and queries, or a user making implementation choices of a product that is based on these technologies.

When you start having performance concerns, don’t even bother looking at how much time is being "wasted" by operations that cannot be avoided.  Focus on the things you can change with larger scope, and it will be time well spent.  When everything is humming along perfectly, that’s when you can stop to engage in the inevitable geek behavior of taking apart the NES cartridge to see if you can rig it to give you infinite lives by snipping this one transistor.

My New Bike That I Cannot Ride

So I guess I posted some things out of order, for instance the pedals for the new bike.  Well, I got new bikes for my wife and me for our anniversary this year.  Let us say that I am lessed than pleased with the timing of an injury, one of my diagnoses yesterday being that of a broken foot.

image

It’s a 2006 (new, never ridden) Haro Shift R3.  The doctor said that I have to keep my foot from bending for about 8 weeks - since it’s a non-displaced break, I won’t have a cast.  So I keep trying to tell myself that my Shimano mountain biking shoes with their extremely hard, stiff soles would actually be a therapeutic device, and that I’d be fine to ride my bike.  Right?

Just an Average Friday

I have 19 browser windows open, all with multiple tabs related to that window’s reason for being open.  Is it time to go home yet?  Oh drat, I work at home.  Is it time to go outside yet?

WildBlue Gmail Labs

WildBlue not too many months ago switched their email over to Gmail for Domains, which vastly improved end user’s email and account management software.  I utilize IMAP with my WildBlue email account so I can have local offline access to all of my email across all of my devices.  Gmail’s IMAP implementation, though, leaves a bit to be desired.  Thankfully, the engineers at Google have just added a Lab to add Advanced IMAP controls to Gmail, which address the major bullet points.  Labs however are not available to users of Gmail for Domains unless the domain administrator has turned on new features for their domain’s users.

So I wanted to email the network admins at WildBlue, and put in a request to toggle this option on, so we can have access to the Labs tab in our Gmail account settings.  Not finding any email addresses after navigating WildBlue’s support pages, I was directed to chat with an online representative.  It went surprisingly well, I must say, compared to other company’s chat driven support.  The support agent was willing to listen to me, read the links I provided, but in the end was completely unable to help me.

This is a long standing problem with WildBlue: a Great Wall, a barrier, between not only end users and network engineers, but between WildBlue’s own staff and the network administrators.  If you call, you’ll get the same answer.  Support staff, even management, have no idea how to contact anyone at WildBlue that can actually do anything regarding network connectivity and configuration.  Needless to say, this is frustrating as all get out.

Below is the chat transcript.  My thanks to Kima for listening to me, and for taking the time to read to become educated on a topic that was obviously not in the support rep flowchart / handbook that is typical of ISP support interactions.  And no thanks to WildBlue for hedging even your own employees from being able to contact administrators and engineers within your own company.  Hopefully one of the latter will stumble upon this entry, as I have no idea of any other way to get that information to them.  The customer care department at WildBlue apparently doesn’t know how to reach you either.

Tikima_W
Thank you for contacting WildBlue Customer Service. My name is Kima, how may I be of assistance today?
Derek Jones
Hi, I wanted to contact the administrators for WildBlue that handles settings for the Gmail for domains, to enable Labs for us, please
Derek Jones
http://mail.google.com/support/bin/answer.py?hl=en&answer=29418
Derek Jones
I need to have access to the new advanced IMAP configuration settings, to optimize how I connect to WildBlue for IMAP
Derek Jones
http://gmailblog.blogspot.com/2008/10/new-in-labs-advanced-imap-controls.html
Tikima_W
Derek since this labs are created and maintained by Google. You will need to contact google’s webmaster for more assistance.
Derek Jones
No, that’s not correct
Derek Jones
WildBlue runs on Gmail via “Gmail for domains”
Derek Jones
Someone at WildBlue controls and maintains the settings for that domain, not Google
Derek Jones
Please see the first link, which provides instructions for how administrators can enable the Labs tab for the domain
Derek Jones
It will then appear under “Settings” in Gmail for all WildBlue customers
Derek Jones
If you have an email address for the network administrators, I’d be happy to email my request directly to that department, but I could not find one on the support page.
Tikima_W
Derek give me 3 min to look over these links.
Derek Jones
No problem, thank you!
Derek Jones
(If you have a non-WildBlue gmail account, you can see this tab there, as “normal” GMail users automatically have access to it)
Tikima_W
Thank you for holding Derek. I have looked over both links, and Gmail maintains all these settings, you will need to contact Google directly for this issue.
Derek Jones
Kima, thank you for looking into it, but Google is going to tell me to contact my domain administrator. That is WildBlue.
Derek Jones
Google for Domains is a feature of Google that corporations can use to run their email via GMail. But Google staff does not manage any accounts nor their settings. You set that up when you create your Google for Domains account.
Tikima_W
The labs are experimental through google, there are no settings configurations WildBlue has access to.
Derek Jones
Hang on one second please while I find the link to the step by step.
Derek Jones
It’s a setting in the main options panel for the domain adminstrator
Derek Jones
http://gmailblog.blogspot.com/2008/06/introducing-gmail-labs.html
Derek Jones
Please see the very bottom, the “Update” note
Derek Jones
“Domain Settings” is a settings area available only to domain administrators, those who manage WildBlue’s GMail for Domains program
Tikima_W
Yes I see that, however experimental labs most likely not be activated.
Derek Jones
We would have access to the Labs tab in our own Settings, and can choose to enable or disable the Labs that GMail engineers make available there.
Tikima_W
Understood, since these are experimental. They will most likely not be used.
Derek Jones
With all due respect, is there an email address I can use to contact someone who is in a position to make that decision?
Derek Jones
I’d really like to discuss this with WildBlue’s network administrators.
Tikima_W
No
Derek Jones
Ok, thank you for you time.
Derek Jones
*your
Tikima_W
You can however send an email to our Customer Dept at customercare@wildblueworld.com

Ah yes, the Customer Care department.  Which brings me back full circle to where I started.  ::sigh::

If you are or know a network administrator for WildBlue, please alert the right people to my request.  If the answer is no, that’s certainly WildBlue’s prerogative, but my frustration lies in not even being able to communicate my request to the appropriate staff.

Trailguru

The iPhone Trailguru app is free, as is the online service.  Here’s a brief rundown of what the two do.  Whenever you go running, biking, snowboarding, walking, horseback riding, whatever, the iPhone application (requires 3G for GPS) tracks your route, time, distance, max, min, average, and current speed, and elevation changes.  Handy.

Ok, now from the iPhone app, you post your tracks to the Trailguru online service, which is a rather clever use of MediaWiki and social networking, with a UI that is kind of bleh, but is quite usable.  If you don’t know me, then it should be stated that wikis and social networks have utterly failed to ever impress me.  I avoid and typically abhor most.  So when I say that this one is not only useful and compelling, that should tell you something.  Anyway, you can upload your GPS track as either private, friends-only, or public.  It will create the data, bound to a wiki article so you can write a description for it or whatever.  The coolest part, it displays it over a Google map, or you can display it externally in Google Earth.

image

Even better, you can animate it, and the map marker will follow your path along your route.  How cool is that?  You can also add photos from the trip, download a GPS data file for it, subscribe to a Google Maps / Earth RSS feed, and it keeps track of all manner of statistics for your tracks to make detailed reports and graphs.  You just can’t beat that, particularly since it’s free.