Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.5.6
-
None
-
Mariadb 11.4.5
A test database with at least 3000+ Stored procedures
Description
This issue happens whenever we call a Stored Procedure with at least 1 parameter from Java and we set the parameter using the parameter name e.g.
String sqlQuery = "{CALL STORED_PROCEDURE_TEST(?)}"; |
CallableStatement cStmt = null; |
|
|
try { |
|
|
cStmt = connection.prepareCall(sqlQuery);
|
cStmt.registerOutParameter("TEST", Types.INTEGER); |
cStmt.execute();
|
}
|
|
|
catch (SQLException e) { |
.....
|
}
|
This causes the connector to fire the call
SELECT * from information_schema.PARAMETERS WHERE SPECIFIC_NAME = 'STORED_PROCEDURE_TEST' AND SPECIFIC_SCHEMA = 'testdb' ORDER BY ORDINAL_POSITION;
|
This takes ~0.3 seconds and is significantly slower than our previous version of connector J which was 2.7.1 which took ~0.01s
Note that the previous version did not make this query and instead was using the mysql.proc table i.e.
select param_list, returns, db, type from mysql.proc where name=? and db=
|
Another peculiar thing I found is that if you remove the ORDER BY clause in the metadata fetch , the query speeds up by up to 30x. In addition I have checked the Handler_tmp_write and Rows_tmp_read variables:
- They are both 30000+ with the ORDER BY clause
- They are 1 without the ORDER BY clause