List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:October 26 2007 4:49pm
Subject:Re: Comparing keys in two tables
View as plain text  
Rob Wultsch wrote:
> On 10/26/07, Baron Schwartz <baron@stripped> wrote:
>> Aaron Fischer wrote:
>>> Thanks Peter and Baron, these both worked well.
>>>
>>> The "left join on" took .1919 seconds and the "left outer join as" took
>>> .1780 seconds.
>> They are synonymous in MySQL.  The only difference is 6 extra characters
>> in the query text.  The difference was probably due to caches.
>>
>> Baron
>>
>> Out of curiosity which cache are you referring to?
> 
> 3.23 does not have query cache. Are you referring to key, table, or some
> other cache? (or all of the above?)
> 
> I would think that the key and table cache would not be effected by the
> addition of an optional word that does not affect how the query is
> processed...
> 
> Where is my understanding incorrect or incomplete?

I'm referring to the operating system's caches.  Really such a small 
difference isn't significant anyway -- who knows what was happening on 
the server at that time.  But running a query, then running it again, 
will often be at least a tiny bit faster the second time because the 
data has been read from disk into the OS caches.

The query cache (in newer versions) wouldn't help because the queries 
aren't byte-for-byte identical.

If one did a proper benchmark on these two queries and found any 
difference at all aside from "six extra bytes", I'd be very surprised.
Thread
Comparing keys in two tablesAaron Fischer26 Oct
  • Re: Comparing keys in two tablesBaron Schwartz26 Oct
  • Re: Comparing keys in two tablesPeter Brawley26 Oct
    • Re: Comparing keys in two tablesAaron Fischer26 Oct
      • Re: Comparing keys in two tablesBaron Schwartz26 Oct
        • Re: Comparing keys in two tablesRob Wultsch26 Oct
          • Re: Comparing keys in two tablesBaron Schwartz26 Oct
      • Re: Comparing keys in two tablesPeter Brawley26 Oct
  • Re: Comparing keys in two tablesmysql26 Oct