Enhancement: Add support for not logging calls to stored procedure in the slow query log
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Wishlist
|
Sergei Glushchenko | ||
5.5 |
Fix Released
|
Wishlist
|
Sergei Glushchenko | ||
5.6 |
Fix Released
|
Wishlist
|
Sergei Glushchenko |
Bug Description
Customer would like to be able to avoid logging any calls to stored procedures to the slow query log.
From customer:
... in our case, our Stored Procedures iterate through a large input string and execute many SQL statements for each of the members of that input string. We know that the Stored Procedure can take several seconds to do all of that work, but we don't really care because we're saving literally millions of database roundtrips a day, and each individual INSERT or UPDATE only takes a millisecond or so. We'd still like to be aware of individual statements taking longer than 1 second (or whichever relevant time as configured by long_query_time). But we don't want 2 Gigabytes of slow_query.log output a day for CALLs to stored procedures we know will be longer than 1 second.
Related branches
- Laurynas Biveinis (community): Approve
-
Diff: 277 lines (+112/-26)6 files modifiedmysql-test/r/percona_log_slow_sp_statements.result (+46/-10)
mysql-test/t/percona_log_slow_sp_statements.test (+33/-5)
sql/log.cc (+9/-0)
sql/sp_head.cc (+0/-8)
sql/sp_rcontext.h (+2/-3)
sql/sql_parse.cc (+22/-0)
- Laurynas Biveinis (community): Approve
-
Diff: 227 lines (+103/-17)5 files modifiedmysql-test/r/percona_log_slow_sp_statements.result (+46/-10)
mysql-test/t/percona_log_slow_sp_statements.test (+33/-5)
sql/log.cc (+9/-0)
sql/sp_instr.h (+0/-2)
sql/sql_parse.cc (+15/-0)
tags: | added: i43131 |
It makes perfect sense to add this to the wishlist. Not sure how easy it will be to still log slow queries inside stored routine though.