List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:December 30 2008 11:10pm
Subject:Re: Performance tips
View as plain text  
Hi Jim,

On Tue, Dec 30, 2008 at 5:54 PM, Jim Lyons <jlyons4435@stripped> wrote:
> On Sat, Dec 27, 2008 at 12:38 PM, Jake Maul <jakemaul@stripped> wrote:
>> 3) Obviously it'd probably be faster if you weren't using
>> SQL_NO_CACHE... guessing you just did that to show us what it's like
>> that way?
> Why would SQL_NO_CACHE slow it down?  By not checking the cache or storing

Because then it might be possible to return the query from the cache.

> the resultset into cache it should be quicker, at least a little bit.
> Unless, of course, the query would always return the same result set.  But
> with count(*) in there it might not.  In fact, I believe the count(*) would
> prevent MySQL from caching the query in the first place, like using now() -
> it's a non-deterministic function.

No, it should always return the same thing unless the data in the
table changes, so it's perfectly cacheable.

Baron Schwartz, Director of Consulting, Percona Inc.
Our Blog:
Our Services:
Performance tipsChris Picton27 Dec
  • Re: Performance tipsJake Maul27 Dec
    • Re: Performance tipsJim Lyons30 Dec
      • Re: Performance tipsBaron Schwartz31 Dec
  • Re: Performance tipsDan Nelson27 Dec
  • Re: Performance tipsewen fortune27 Dec
    • Re: Performance tipsewen fortune27 Dec