MySQL unique key

17 08 2006

Content moved to




2 responses

31 08 2007

this test is inaccurate. The query was cached by mysql engine

2 09 2007

Hi Andres.

I don’t want to get into the technicalities of caching, but my intuition tells me that it was cached before and after the test because this query executes hundreds of times a day and executing them one after the next without the unique key would not improve the original 30+ seconds it took to return. The unique key definitely improves performance quite a bit. Maybe if you could clear the cache and rerun it it would not return in 0.00 seconds, but in the sub-second range – still INCREDIBLE improvement.

This post is not meant to be a benchmark, but a reference on how to add unique keys ;)

Thanks for your input, and any further comments welcome.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: