Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8305

Add ability to track "slow" stored procedures in slow query log

    XMLWordPrintable

Details

    Description

      Please add the ability to track "slow" stored procedures in slow query log.

      Perhaps this could be backported from Percona Server.

      They currently have the option:

      log_slow_sp_statements

      If TRUE, statements executed by stored procedures are logged to the slow if it is open.

      https://www.percona.com/doc/percona-server/5.5/diagnostics/slow_extended_55.html#log_slow_sp_statements

      There are quite a few more details listed there which may help shed light on the implementation, such as:

      Prior to 5.5.41-37.0 implementation of logging stored procedures was logging the stored procedure CALLs themselves along with the queries inside the procedures. This meant that some queries were counted more than once which could make tracking the bad-performing queries harder and it would cause noise in the slow query log. Percona Server 5.5.41-37.0 implemented improvements for logging of stored procedures to the slow query log:

      • Each query from a stored procedure is now logged to the slow query log individually
      • CALL itself isn’t logged to the slow query log anymore as this would be counting twice for the same query which would lead to incorrect results
      • Queries that were called inside of stored procedures are annotated in the slow query log with the stored procedure name in which they run.

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              ccalender Chris Calender (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.