Bug #81427 Connector uses a slow INFORMATION_SCHEME.ROUTINES
Submitted: 16 May 2016 6:52 Modified: 16 May 2016 7:47
Reporter: Andrey L Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.9.8 OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[16 May 2016 6:52] Andrey L
Description:
For each request connector refers to the table INFORMATION_SCHEMA.ROUTINES to check for metadata. Table INFORMATION_SCHEMA.ROUTINES contains more 40K and query  SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA LIKE 'dev' AND ROUTINE_NAME LIKE 'proc1' takes time 90 seconds. This is very slow.

How to repeat:
use Connector/NET to call stored procedures and enable log the SQL issued. Wee see SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA LIKE 'dev' AND ROUTINE_NAME LIKE 'proc1', but expect to see SELECT * FROM mysql.proc WHERE 1=1 AND db LIKE 'dev' AND name LIKE 'proc1';

Suggested fix:
MySqlConnectionStringBuilder.cs

public MySqlConnectionStringBuilder(string connStr)
      : base()
    {
      lock (this)
      {
        ConnectionString = connStr;
      }
    }
change to
public MySqlConnectionStringBuilder(string connStr)
      : this()
    {
      lock (this)
      {
        ConnectionString = connStr;
      }
    }
[16 May 2016 7:47] Chiranjeevi Battula
Hello  Андрей rsvgsrdsrgvrsv,

Thank you for the bug report.
This is most likely duplicate of Bug #74116, please see Bug #74116.

Thanks,
Chiranjeevi.