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
this test is inaccurate. The query was cached by mysql engine
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