Details
-
New Feature
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
In a case when slow query contains huge TEXT/BLOB values it becomes impractical to have such queries in the log. Think of a case when a slow INSERT or UPDATE contains TEXT values longer than 1MB.
In such case it would be good to have an option to truncate the query to some reasonably long size which would still reveal the nature of the query, but will not flood the log with too much information.
This will indeed create a problem for mysqldumpslow tool and parsing the log in general, for which it would be best if only the values are truncated, but that means parsing and processing the query before logging it into slow log which in my opinion is too much extra effort for such corner cases.
Alternatively, instead of introducing another option, this could be an extension of log_slow_verbosity
If such option is introduced should be disabled by default or zero meaning no truncation.
Truncating the query does not seem to be a good idea at least to me, given that you want to know the exact query which was slow. Truncating the values of some data types like BLOB values could be an option, the question still is if such a huge BLOB can be the reason why the query ended up in the slow query log. In that case such data should not just be truncated but should at least get some information about the size added, that it is still clear why the query was logged at all