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

COM_Select goes up together with Qcache_hits

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.5.39, 10.0.14
    • Fix Version/s: 10.0, 5.5
    • Component/s: None
    • Labels:
      None

      Description

      According to the KnowledgeBase:

      "Note that queries returned from the query cache do not increment the Com_select status variable, so to find the total number of valid queries run on the server, add Com_select to Qcache_hits."
      ( https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/buffers-caches-and-threads/query-cache/ )

      This is true for MySQL, but not for MariaDB where Com_select actually does seem to get incremented even on query cache hits. Not sure whether this was an intended change (IMHO the MariaDB behaviour is the more correct one), but it is in contradiction to the documented state for sure.

      MariaDB [test]> CREATE TABLE t1 (id INT PRIMARY KEY);
      Query OK, 0 rows affected (0.06 sec)
      
      MariaDB [test]> INSERT INTO t1 VALUES (1);
      Query OK, 1 row affected (0.02 sec)
      
      MariaDB [test]> SHOW GLOBAL STATUS WHERE Variable_name IN ('Com_select', 'Qcache_hits');
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | Com_select    | 0     |
      | Qcache_hits   | 0     |
      +---------------+-------+
      2 rows in set (0.00 sec)
      
      MariaDB [test]> SELECT * FROM t1;
      +----+
      | id |
      +----+
      |  1 |
      +----+
      1 row in set (0.00 sec)
      
      MariaDB [test]> SHOW GLOBAL STATUS WHERE Variable_name IN ('Com_select', 'Qcache_hits');
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | Com_select    | 1     |
      | Qcache_hits   | 0     |
      +---------------+-------+
      2 rows in set (0.00 sec)
      
      MariaDB [test]> SELECT * FROM t1;
      +----+
      | id |
      +----+
      |  1 |
      +----+
      1 row in set (0.00 sec)
      
      MariaDB [test]> SHOW GLOBAL STATUS WHERE Variable_name IN ('Com_select', 'Qcache_hits');
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | Com_select    | 2     |
      | Qcache_hits   | 1     |
      +---------------+-------+
      2 rows in set (0.00 sec)
      
      MariaDB [test]> SELECT * FROM t1;
      +----+
      | id |
      +----+
      |  1 |
      +----+
      1 row in set (0.00 sec)
      
      MariaDB [test]> SHOW GLOBAL STATUS WHERE Variable_name IN ('Com_select', 'Qcache_hits');
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | Com_select    | 3     |
      | Qcache_hits   | 2     |
      +---------------+-------+
      2 rows in set (0.00 sec)
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -

              It appears to be an intentional change, made in scope of MDEV-4981. Assigning to Oleksandr Byelkin to double-check that it was really thought through, and if so, get the documentation be updated accordingly.

              Show
              elenst Elena Stepanova added a comment - It appears to be an intentional change, made in scope of MDEV-4981 . Assigning to Oleksandr Byelkin to double-check that it was really thought through, and if so, get the documentation be updated accordingly.
              Hide
              LucasRolff Lucas Rolff added a comment - - edited

              Would love to get this double-checked as well, a lot of tools to measure query stats depend heavily on the Com_select and Qcache_hits values, this also means people using tools such as Munin, or Graphite will need to make very MariaDB specific code, since else you'll get graphs like this:

              It would be nice if we can use most MySQL plugins for monitoring, since MariaDB is advertised as "An enhanced, drop-in replacement for MySQL". Then we should also be able to measure data/statistics the same way, but with additional features. I believe you can achieve the same data you want in MDEV-4981 by combining some numbers from the Com_* and Qcache_* variables.

              Show
              LucasRolff Lucas Rolff added a comment - - edited Would love to get this double-checked as well, a lot of tools to measure query stats depend heavily on the Com_select and Qcache_hits values, this also means people using tools such as Munin, or Graphite will need to make very MariaDB specific code, since else you'll get graphs like this: It would be nice if we can use most MySQL plugins for monitoring, since MariaDB is advertised as "An enhanced, drop-in replacement for MySQL". Then we should also be able to measure data/statistics the same way, but with additional features. I believe you can achieve the same data you want in MDEV-4981 by combining some numbers from the Com_* and Qcache_* variables.
              Hide
              LucasRolff Lucas Rolff added a comment - - edited

              Oleksandr Byelkin will you look into this?

              Show
              LucasRolff Lucas Rolff added a comment - - edited Oleksandr Byelkin will you look into this?
              Hide
              sanja Oleksandr Byelkin added a comment -

              Of course I will (when come its time)

              Show
              sanja Oleksandr Byelkin added a comment - Of course I will (when come its time)
              Hide
              sanja Oleksandr Byelkin added a comment -

              The case is looks simple, but there is non-simple question why it was changed which needs time to figure out.

              Show
              sanja Oleksandr Byelkin added a comment - The case is looks simple, but there is non-simple question why it was changed which needs time to figure out.
              Hide
              LucasRolff Lucas Rolff added a comment -

              Any news about this?

              Show
              LucasRolff Lucas Rolff added a comment - Any news about this?

                People

                • Assignee:
                  sanja Oleksandr Byelkin
                  Reporter:
                  hholzgra Hartmut Holzgraefe
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated: