MySQL unique key

17 08 2006

Content moved to http://awesomeful.net/posts/19-mysql-unique-key

Advertisements

Actions

Information

2 responses

31 08 2007
Andres

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

2 09 2007
H

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.
-H

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: