• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I get MySQL to perform queries without any kind of caching?

#1
[eluser]warpspasm[/eluser]
I have a JSON controller that makes a number of MySQL queries. One of the queries seems to have gotten slower but I don't know which one it is.

The problem is that sometimes the query is slow and then other times it is faster (especially if I run the same request immediately afterwards.)

This leads me to believe that MySQL is doing some kind of caching?

So, my question is: How can I get CodeIgniter / MySQL to run queries without any kind of caching so that I can start tracing which query is causing the problems?

Thanks for any ideas on how to get started on this!

Chris

#2
[eluser]boltsabre[/eluser]
Google helps for these kinds of things, literally 100's of valid answers. Here is what I got in position 1:

http://stackoverflow.com/questions/18189...d-of-query

From the search query "how to stop mysql from caching results". Scroll down the page, I use the NOW() option.

Good luck bug hunting your queries, hope you find the culprit!

One other thing that springs to mind, try rebuilding you indexes, that should give you some instant improvement regarding speed.

#3
[eluser]CroNiX[/eluser]
The profiler will show you all of the queries being run during an execution cycle, along with their memory consumption and query time. Good for troubleshooting stuff like this.

#4
[eluser]CroNiX[/eluser]
Also make sure you turn off caching in your ajax call (if you're using jQuery there is an $.ajax setting for that) and check to see if you have CI's Query Caching enabled. Those could also affect that.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.