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

SET STATEMENT min_examined_row_limit has no effect

    XMLWordPrintable

    Details

      Description

      set global log_output = 'TABLE', global slow_query_log = 1;
      set slow_query_log = 1;
      set min_examined_row_limit = 0;
      truncate table mysql.slow_log;
      set long_query_time = 0.000001;
      set statement min_examined_row_limit = 50 for select sleep(0.1) union select sleep(0.1);
      select * from mysql.slow_log;
      set min_examined_row_limit = 50;
      select sleep(0.1) union select sleep(0.1);
      select * from mysql.slow_log;

      MariaDB [test]> set statement min_examined_row_limit = 50 for select sleep(0.1) union select sleep(0.1);
      +------------+
      | sleep(0.1) |
      +------------+
      |          0 |
      +------------+
      1 row in set (0.27 sec)
       
      MariaDB [test]> select * from mysql.slow_log;
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+-----------------------------------------------------------------------------------------+-----------+
      | start_time                 | user_host                    | query_time      | lock_time       | rows_sent | rows_examined | db   | last_insert_id | insert_id | server_id | sql_text                                                                                | thread_id |
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+-----------------------------------------------------------------------------------------+-----------+
      | 2014-11-02 13:48:49.526899 | root[root] @ localhost [::1] | 00:00:00.000089 | 00:00:00.000000 |         0 |             0 | test |              0 |         0 |         2 | set long_query_time = 0.000001                                                          |         5 |
      | 2014-11-02 13:48:49.790968 | root[root] @ localhost [::1] | 00:00:00.201339 | 00:00:00.000000 |         1 |             1 | test |              0 |         0 |         2 | set statement min_examined_row_limit = 50 for select sleep(0.1) union select sleep(0.1) |         5 |
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+-----------------------------------------------------------------------------------------+-----------+
      2 rows in set (0.00 sec)
       
      MariaDB [test]> set min_examined_row_limit = 50;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> select sleep(0.1) union select sleep(0.1);
      +------------+
      | sleep(0.1) |
      +------------+
      |          0 |
      +------------+
      1 row in set (0.20 sec)
       
      MariaDB [test]> select * from mysql.slow_log;
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+-----------------------------------------------------------------------------------------+-----------+
      | start_time                 | user_host                    | query_time      | lock_time       | rows_sent | rows_examined | db   | last_insert_id | insert_id | server_id | sql_text                                                                                | thread_id |
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+-----------------------------------------------------------------------------------------+-----------+
      | 2014-11-02 13:48:49.526899 | root[root] @ localhost [::1] | 00:00:00.000089 | 00:00:00.000000 |         0 |             0 | test |              0 |         0 |         2 | set long_query_time = 0.000001                                                          |         5 |
      | 2014-11-02 13:48:49.790968 | root[root] @ localhost [::1] | 00:00:00.201339 | 00:00:00.000000 |         1 |             1 | test |              0 |         0 |         2 | set statement min_examined_row_limit = 50 for select sleep(0.1) union select sleep(0.1) |         5 |
      | 2014-11-02 13:48:49.793186 | root[root] @ localhost [::1] | 00:00:00.000394 | 00:00:00.000112 |         2 |             2 | test |              0 |         0 |         2 | select * from mysql.slow_log                                                            |         5 |
      +----------------------------+------------------------------+-----------------+-----------------+-----------+---------------+------+----------------+-----------+-----------+-----------------------------------------------------------------------------------------+-----------+
      3 rows in set (0.00 sec)

      All the same in Percona server.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: