Bug #76605 slow query with grant all on *.* to xxx
Submitted: 7 Apr 2015 4:32 Modified: 8 Jun 2018 8:16
Reporter: liu ping Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.6.23 & 5.6.24 OS:Linux (Linux iZ28ihpu0pyZ 3.10.0-123.9.3.el7.x86_64 #1 SMP Thu Nov 6 15:06:03 UTC 2014 x86_64 x86_64 x86_64)
Assigned to: CPU Architecture:Any

[7 Apr 2015 4:32] liu ping
Description:
if use grant all on *.*  in MySQL 5.6.23 and MySQL 5.6.24 has very slow query, but use grant all on database.* is fast.

How to repeat:
And we do the following test:
1: delete user test grant in mysql by : delete from user where user='test'
2: use grant all on database1.* to 'test'@'ip_address' IDENTIFIED BY 'test';
3: restart mysql
4: execute the long query 5 times.
in this case , we found the first time is slow, take about 13 second. it's ok, but the second and next times ,the query is very fast, less than 1 second (we use query case).

the other test case:
1: delete user test grant in mysql by : delete from user where user='test'
2: use grant all on *.* to 'test'@'ip_address' IDENTIFIED BY 'test';
3: restart mysql
4: execute the long query 5 times.
and now, the first time also take about 13 second, but the second and next times ,the query also very slow , it's take about 9 second.

why?

in those case, we use the same machine ,same my.cnf file, same MySQL Server instance, same database
[8 May 2018 8:16] MySQL Verification Team
Sorry to be late, please try 5.6.40. Thanks.
[9 Jun 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".