Yet another slow-query question.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is it possible that the elapsed time being measured includes waiting for the
client to acknowledge that it has received all the data?  In *addition* to
the server execution time?

Documentation seems to *imply* that the slow query log only looks at server
execution time.  But, it doesn't acknowledge this directly and there seems
to be a distinct connection between slow network pipes and slow queries.

For example - even the simplest indexed queries
tends to show up as a slow query *if* the requesting client is using a slow
dial up connection.

I know there are other possible reasons the server might be too busy to
respond quickly BUT the circumstantial evidence is strong.
Can anyone confirm (or refute) this?

What exactly does that variable [long_query_time] include/exclude ?
Thomas Bartkus

Re: Yet another slow-query question.

Quoted text here. Click to load it

Answering my own question.

[long_query_time] measures the time between the moment MySQL receives the
request until the requesting host acknowledges receipt of the results.

This means that for SELECT queries, the query time will include the data
delivery time.
Such queries might be flagged as slow simply because the network connection
is slow.

If the requesting host is a slow dial up connection requesting large data
sets, those queries will always appear in the slow-query log no matter how
fast the server might be responding.

Thomas Bartkus

Site Timeline