|
There's a few things you can do.
don't try and grep the whole select statement, just pick a few words or so.
so if you saw
select one, two, three, four, five from a, b, c where a.id = b.aid blah blah blah
just
grep -r "select one, two, three, four" /var/www/public_html/
and even then, it might no show up, sometimes there's a library abstracting the sql
also turn on slow query logging in my.cnf
and lastly, if you have enough memory, mount /tmp on tmpfs but if you're already running out of memory, that might make things worse.
|