Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] How to check when a MySQL table was last SELECTED



On 9 March 2011 14:14, zev <zev@example.com> wrote:

> On Mar 9, 2011, at 9:10 PM, Josh Glover wrote:
>
>> On 9 March 2011 11:54, Sach Jobb <sach@example.com> wrote:
>>
>>> Does anyone know if there is a way to get when a table was last used
>>> by a SELECT?
>>
>> Check the bin logs yourself? Gross, though...
>
> Bin log will only record the modifications, so SELECT will not be logged.

Ah, good point.

> If the SELECT was slow and you had slow_query logging turned on
> it would show up there.  Depending upon the version you could log all
> selects by making the slow_query threshold extremely small.

Be careful; I set the threshold to 0 last week in an attempt to
disable the slow query log (I think that worked in MySQL 5.0, but we
just upgraded one DB to 5.1) and generated 200G of logs in a couple of
hours. :-/

> Actually, maybe MySql Proxy would do a good job of that.

Good idea. You could also simply proxy the client through netcat and tee, right?

-- 
Cheers,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links