Re: SQL_NO_CACHE

2009-03-04 Thread Johan De Meersman
On Wed, Mar 4, 2009 at 8:42 PM, Morten Primdahl wrote: > around while trying to figure out why the first query was slow and the > subsequent snappy. Given that you posted that a MySQL restart does not change anything, but a system restart does, I put my money on the filesystem cache having buffer

Re: SQL_NO_CACHE

2009-03-04 Thread Morten Primdahl
On Mar 4, 2009, at 8:38 PM, Jocelyn Fournier wrote: Just curious : if there's no index on the column why don't you try to add one ? That's probably why it takes a lot of time on the production machine. Hehe.. I can understand why you ask, I over simplified the question which was wrong of

Re: SQL_NO_CACHE

2009-03-04 Thread Jocelyn Fournier
Just curious : if there's no index on the column why don't you try to add one ? That's probably why it takes a lot of time on the production machine. Jocelyn Le 04/03/2009 18:26, Morten Primdahl a écrit : Thanks for all the suggestions. The caching must be done somewhere else. There is no

Re: SQL_NO_CACHE

2009-03-04 Thread Micah
I did some tests a couple of weeks ago, using using SQL_NO_CACHE and clearing out the OS buffer after each query was enough to give me consistent results that were based on system load rather than cache efficiency. These two are by far the major factors in my experience, although no doubt other

Re: SQL_NO_CACHE

2009-03-04 Thread jocelyn fournier
MySQL Key buffer and OS cache could also have an impact. Have you tried disabling the Key Buffer first ? Jocelyn Le 04/03/2009 18:26, Morten Primdahl a écrit : Thanks for all the suggestions. The caching must be done somewhere else. There is no index on the column and there are about 500.00

Re: SQL_NO_CACHE

2009-03-04 Thread Morten Primdahl
Thanks for all the suggestions. The caching must be done somewhere else. There is no index on the column and there are about 500.000 rows in the table. A MySQL restart doesn't "flush" the cache in play, but a full restart of my laptop does (OS X). I may be chasing the wrong problem, but w

Re: SQL_NO_CACHE

2009-03-04 Thread jocelyn fournier
If SQL_NO_CACHE is specify, the cache will never be used : The Query Cache behaviour is quite simple, it uses the exact given query syntax as a hash to search into the query cache; it means writing 'select' or 'SELECT' is different. It also means adding SQL_NO_CACHE will search in the cache for

Re: SQL_NO_CACHE

2009-03-04 Thread Perrin Harkins
On Wed, Mar 4, 2009 at 11:23 AM, Thomas Spahni wrote: > SQL_NO_CACHE means that the query result is not cached. It does not mean > that the cache is not used to answer the query. Oh, right, he's looking for this: SET SESSION query_cache_type=off; - Perrin -- MySQL General Mailing List For lis

Re: SQL_NO_CACHE

2009-03-04 Thread Thomas Spahni
On Wed, 4 Mar 2009, Morten wrote: Hi, I was hoping that using SQL_NO_CACHE would help me bypass the query cache, but judging from the below it doesn't. What can I do to avoid the query cache? Thanks. Morten mysql> select count(*) from users where email = 'hello'; +--+ | count(*) |

Re: SQL_NO_CACHE

2009-03-04 Thread Perrin Harkins
On Wed, Mar 4, 2009 at 10:27 AM, Morten wrote: > Hi, I was hoping that using SQL_NO_CACHE would help me bypass the query > cache, but judging from the below it doesn't. You probably just brought the data into the cache and are not hitting the query cache. - Perrin -- MySQL General Mailing List

Re: SQL_NO_CACHE

2009-03-04 Thread Micah Stevens
Keep in mind the file system caches too, so it might be working, but the file access is still getting put in memory. You should disable that too if you really want consistent results. In Linux you can dump the file system cache between each query, I have no clue how to do it in windows or other sy

RE: sql_no_cache

2004-04-27 Thread Boyd E. Hemphill
In an update to the last, I think I have the issue in hand: I am using TOAD 1.0 and it seems to be doing some sort of caching itself or going directly to the query cache. I issued the identical query and it would return the result immediately. Checking Mytop (did I mention that JZ rules?) the q

RE: sql_no_cache

2004-04-27 Thread John McCaskey
One possibility is that the OS has the portion of disk that the row is stored in cached in memory via its normal disk caching after the first execution. Another possibility is that the key for the table is in mysql's key_buffer after the first execution. If you are using innodb then it might be c

Re: SQL_NO_CACHE

2004-01-13 Thread Tobias Asplund
On Tue, 13 Jan 2004, Priyanka Gupta wrote: > Hi, > > I am trying to do some performance analysis by trying different indexing > schemes and testing how long it takes. To get consistent results, I would > like to use something like SQL_NO_CACHE. However, the mysqld version that I > have installed d