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

Massive performance impact after PTI fix

Details

    Description

      Hello

      I have just applied the PTI patch on the OS and it is causing a massive difference in the execution time of a specific query.

      Disabling and reenabling PTI enables me to reproduce the difference at will :

      PTI disabled : 7s
      PTI enabled : 87s

      The query :

      SELECT * FROM `test` as b1 WHERE b1.`dateFin` > '2018-01-24' AND NOT EXISTS (SELECT 1 FROM `test` as b2 WHERE b2.`ip` = b1.`ip` AND b2.`dateFin` > b1.`dateFin`);
      

      Explain doesn't help much :

      +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
      | id   | select_type        | table | type | possible_keys | key  | key_len | ref  | rows | Extra       |
      +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
      |    1 | PRIMARY            | b1    | ALL  | NULL          | NULL | NULL    | NULL | 4499 | Using where |
      |    2 | DEPENDENT SUBQUERY | b2    | ALL  | NULL          | NULL | NULL    | NULL | 4499 | Using where |
      +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
      

      Can't see any report matching that kind of difference so far so i'm wondering what's up

      Attachments

        Issue Links

          Activity

            falcoris Jean-Marc Messina created issue -
            serg Sergei Golubchik made changes -
            Field Original Value New Value
            Description Hello

            I have just applied the PTI patch on the OS and it is causing a massive difference in the execution time of a specific query.

            Disabling and reenabling PTI enables me to reproduce the difference at will :

            PTI disabled : 7s
            PTI enabled : 87s

            The query :
            SELECT * FROM `blacklist` as b1 WHERE b1.`dateFin` > '2018-01-24' AND NOT EXISTS (SELECT 1 FROM `blacklist` as b2 WHERE b2.`ip` = b1.`ip` AND b2.`dateFin` > b1.`dateFin`);

            Explain doesn't help much :
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | 1 | PRIMARY | b1 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            | 2 | DEPENDENT SUBQUERY | b2 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+

            Can't see any report matching that kind of difference so far so i'm wondering what's up
            Hello

            I have just applied the PTI patch on the OS and it is causing a massive difference in the execution time of a specific query.

            Disabling and reenabling PTI enables me to reproduce the difference at will :

            PTI disabled : 7s
            PTI enabled : 87s

            The query :
            {code:sql}
            SELECT * FROM `blacklist` as b1 WHERE b1.`dateFin` > '2018-01-24' AND NOT EXISTS (SELECT 1 FROM `blacklist` as b2 WHERE b2.`ip` = b1.`ip` AND b2.`dateFin` > b1.`dateFin`);
            {code}
            Explain doesn't help much :
            {noformat}
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | 1 | PRIMARY | b1 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            | 2 | DEPENDENT SUBQUERY | b2 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            {noformat}
            Can't see any report matching that kind of difference so far so i'm wondering what's up
            falcoris Jean-Marc Messina made changes -
            Affects Version/s 10.1.26 [ 22553 ]
            Environment GNU/Linux Debian 8 Jessie GNU/Linux Debian 8 Jessie
            GNU/Linux Debian 9 stretch
            axel Axel Schwenke made changes -
            Assignee Axel Schwenke [ axel ]
            falcoris Jean-Marc Messina made changes -
            Attachment cossi-ip.sql.gz [ 45016 ]
            falcoris Jean-Marc Messina made changes -
            Comment [ exactly the same output on the execution plan with and without KPTI
            Here are the tables (attached to this ticket) if you want to reproduce the problem [^cossi-ip.sql.gz] ]
            falcoris Jean-Marc Messina made changes -
            Attachment cossi-ip.sql.gz [ 45016 ]
            falcoris Jean-Marc Messina made changes -
            Description Hello

            I have just applied the PTI patch on the OS and it is causing a massive difference in the execution time of a specific query.

            Disabling and reenabling PTI enables me to reproduce the difference at will :

            PTI disabled : 7s
            PTI enabled : 87s

            The query :
            {code:sql}
            SELECT * FROM `blacklist` as b1 WHERE b1.`dateFin` > '2018-01-24' AND NOT EXISTS (SELECT 1 FROM `blacklist` as b2 WHERE b2.`ip` = b1.`ip` AND b2.`dateFin` > b1.`dateFin`);
            {code}
            Explain doesn't help much :
            {noformat}
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | 1 | PRIMARY | b1 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            | 2 | DEPENDENT SUBQUERY | b2 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            {noformat}
            Can't see any report matching that kind of difference so far so i'm wondering what's up
            Hello

            I have just applied the PTI patch on the OS and it is causing a massive difference in the execution time of a specific query.

            Disabling and reenabling PTI enables me to reproduce the difference at will :

            PTI disabled : 7s
            PTI enabled : 87s

            The query :
            {code:sql}
            SELECT * FROM `test` as b1 WHERE b1.`dateFin` > '2018-01-24' AND NOT EXISTS (SELECT 1 FROM `test` as b2 WHERE b2.`ip` = b1.`ip` AND b2.`dateFin` > b1.`dateFin`);
            {code}
            Explain doesn't help much :
            {noformat}
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            | 1 | PRIMARY | b1 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            | 2 | DEPENDENT SUBQUERY | b2 | ALL | NULL | NULL | NULL | NULL | 4499 | Using where |
            +------+--------------------+-------+------+---------------+------+---------+------+------+-------------+
            {noformat}
            Can't see any report matching that kind of difference so far so i'm wondering what's up
            falcoris Jean-Marc Messina made changes -
            Attachment test.sql.gz [ 45019 ]
            axel Axel Schwenke made changes -
            issue.field.resolutiondate 2018-01-26 16:20:27.0 2018-01-26 16:20:27.824
            axel Axel Schwenke made changes -
            Fix Version/s N/A [ 14700 ]
            Resolution Cannot Reproduce [ 5 ]
            Status Open [ 1 ] Closed [ 6 ]
            falcoris Jean-Marc Messina made changes -
            Attachment test.sql.gz [ 45129 ]
            falcoris Jean-Marc Messina made changes -
            axel Axel Schwenke made changes -
            Resolution Cannot Reproduce [ 5 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            axel Axel Schwenke made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            axel Axel Schwenke made changes -
            Component/s Storage Engine - MyISAM [ 10600 ]
            Resolution Won't Fix [ 2 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 85139 ] MariaDB v4 [ 153651 ]

            People

              axel Axel Schwenke
              falcoris Jean-Marc Messina
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.