# innodb: performance (bug?) breakdown using EXISTS

**URL:** <https://forums.percona.com/t/innodb-performance-bug-breakdown-using-exists/7631>\
**Category:** Percona Server for MySQL 8.0\
**Created:** [May 15, 2020, 12:28pm UTC](https://forums.percona.com/t/innodb-performance-bug-breakdown-using-exists/7631 "2020-05-15T12:28:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronny\_Gorner](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ronny_gorner/32/3099_2.png) [@Ronny\_Gorner](https://forums.percona.com/u/Ronny_Gorner)\
**Post date:** [May 15, 2020, 12:28pm UTC](https://forums.percona.com/t/innodb-performance-bug-breakdown-using-exists/7631/1 "2020-05-15T12:28:37Z")

</div>

Hi,I think, on any MySQL 8 release until 8.0.20 there seems to be bug in the innodb engine.We had some issues running tests against a cluster, where just simple selects where extremly slow. So we decided to test a single instance, with Percona 5.7 + 8.0, MySQL Community Server 5.7 + 8.0 and Mariadb 10.4.Interessting was, on Mariadb 10.4, this “error” (in my eyes it is a bug) did not occur, also not in any 5.7 release. It only affects MySQL Community Server 8.0 and Percona Server and Xtradb Cluster in the 8.0 release tree.We also tested around using different Kernel parameters, other innodb settings, we even compared all the over 500+ settings from Mariadb / MySQL and Percona, we run it in containers, we run it on AMD and XEON processors, all I was thinking about, but still the same issues.Please find attached testsetup, which is self-explaining.What is happening:We have a large table, using EXISTS, on MySQL 5.7 and MariaDB 10.4, we have times \< 1 s and it runs well without any impacts;Indeed, using Percona or MySQL Community V8series, it slows down from 1s to 7s, and, that is the absolute nightmare, this query runs even a little longer each time it is executed. Means first run 7s, next around 20s, then 40s, and so on. Absolutly strange.We rewrote the demo-query, and then, voila, we had the 1 s execution time “back”. It must be something with “EXIST” and the behaviour on MySQL8, is this a bug, or any new way it is running on the engine? I missed up any information about it, but the internet / forums are full with same things where people complain about slowing down there queries on MySQL8 and some wrote about EXISTS in their queries, too.Thanks for any ideas,Ronny

[demosetup.txt](https://forums.percona.com/uploads/short-url/caxN9a5hD1F8z7ksdsfY7cgmXJr.txt) (1.45 KB)

---

<div class="post-metadata">

**Author:** ![Ronny\_Gorner](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ronny_gorner/32/3099_2.png) [@Ronny\_Gorner](https://forums.percona.com/u/Ronny_Gorner)\
**Post date:** [May 16, 2020, 7:50am UTC](https://forums.percona.com/t/innodb-performance-bug-breakdown-using-exists/7631/2 "2020-05-16T07:50:35Z")

</div>

Could anyone from percona´s staff assist me in debugging, that we can reproduce it together, and maybe can deeper analyze it?

---

<div class="post-metadata">

**Author:** ![Ronny\_Gorner](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ronny_gorner/32/3099_2.png) [@Ronny\_Gorner](https://forums.percona.com/u/Ronny_Gorner)\
**Post date:** [May 18, 2020, 7:33am UTC](https://forums.percona.com/t/innodb-performance-bug-breakdown-using-exists/7631/3 "2020-05-18T07:33:37Z")

</div>

Confirmed issue: [MySQL Bugs: #99601: Broken Performance using EXIST function, increasing execution time each loop](https://bugs.mysql.com/bug.php?id=99601)

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [May 18, 2020, 8:04am UTC](https://forums.percona.com/t/innodb-performance-bug-breakdown-using-exists/7631/4 "2020-05-18T08:04:30Z")

</div>

Hi Ronny,  
This is great!&nbsp; As you have found MySQL bug&nbsp; [bugs.mysql.com](http://bugs.mysql.com)&nbsp; is right place to report it!  
At Percona we do not tend to change Optimizer as it tends to introduce incompatibilities so wast majority of Optimizer bugs in Percona Server for MySQL are really upsteam bugs.
