Home » Performance » MySQL » Avoiding Stored Procedure Metadata Requests
Avoiding Stored Procedure Metadata Requests [message #3645] Wed, 22 October 2008 06:09
shlomoid  is currently offline shlomoid
Messages: 10
Registered: September 2007
Junior Member
Hi all,

Do you how to prevent the mysql connector/net asking the server for the stored procedure metadata each first execution? I can't seem to find any place that explains how to do that properly.

I've tried providing as much information about the SP parameters as possible, but nothing works.
Here is an example:

When launching a stored procedure from .net, I see this in the general log:
22 Init DB db_name
22 Query SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE OUTINE_SCHEMA='db_name' AND ROUTINE_NAME='mySP'
22 Query SHOW CREATE PROCEDURE `db_name`.`mySP`
22 Query call mySP (10)


It makes sense to get the stored procedure code if the DAL needs to know the data types of the parameters, but it does that even when I am strong-typing the variables as much as I can.
In this case:
MySqlParameter param1 = new MySqlParameter("?p_param", MySqlDbType.Int32);
param1.Value = 10;
param1.Direction = ParameterDirection.Input;
param1.IsNullable = false;
param1.MySqlDbType = MySqlDbType.Int32;

cmd.Parameters.Add(param1);
cmd.ExecuteNonQuery();


Is there a correct way to do this that avoids those queries?

Thanks in advance!
Shlomo
Previous Topic:Simultaneous LOAD DATA INFILE and SELECT
Next Topic:odd replication lag situation
Goto Forum:
  


Current Time: Fri Jul 10 03:27:21 EDT 2009

Total time taken to generate the page: 0.02987 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.