Bug #61136 slow calls to stored procedures with OUT parameters
Submitted: 11 May 2011 20:10 Modified: 11 May 2011 20:29
Reporter: Kai Thiele Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S5 (Performance)
Version:6.3.6 OS:Windows
Assigned to: CPU Architecture:Any
Tags: performance, stored procedure

[11 May 2011 20:10] Kai Thiele
Description:
Connector 6.x.x is much slower than 5.x.x regarding stored procedures.

If you call a stored procedure with OUT-parameters the Connector/Net sends 
for each OUT-parameter a command like SET @_cnet_param_...
(Each of these commands is sent in in an extra IP-packet)

This behavior decreases the performace 
(compared to older Connector/Net versions like 5.2.2 or 5.2.7)
If you have a lot of calls to such stored procedures with many OUT-parameters for example on a 100 Mbit betwork this has bad influence on the performace.

It seems this behaviour beginns with version 6.x.x
With Connector/Net 5.x.x the behavior is correct.
The problem is the extra network traffic.

The Connector/Net should give the same speed as older versions !

How to repeat:
Create a database with a stored procedure having OUT-parameters:

CREATE DATABASE `testdb` DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci;

CREATE DEFINER=`Admin`@`localhost` PROCEDURE `testsp`(OUT p01 INT, IN p02 INT, IN p03 VARCHAR(255), OUT p04 INT, OUT p05 VARCHAR(255)) SQL SECURITY INVOKER BEGIN SET p01=1; SET p04=9; SET p05="abc"; END //

Call this stored procedure via Connector/Net in different versions.
Trace traffic to database with wireshark.

you will see different behaviour:

version 6.3.6 ==>
Statement: SET @_cnet_param_p01=3
Statement: SET @_cnet_param_p04=3
Statement: SET @_cnet_param_p05='String'
Statement: call `testdb`.`testsp` (@_cnet_param_p01, 123, 'xyz', @_cnet_param_p04, @_cnet_param_p05)
Statement: SELECT @_cnet_param_p01, @_cnet_param_p04, @_cnet_param_p05

version 5.2.7 ==>
Statement: call `testdb`.`testsp` (@4152338179p01, 123, 'xyz', @4152338179p04, @4152338179p05)
Statement: SELECT @4152338179p01, @4152338179p04, @4152338179p05

Testing was done against a server 5.0.51a
[11 May 2011 20:29] Reggie Burnett
this has already been fixed in 6.3.7 that will be released in May