Improvement the time to execute parametred queries
--------------------------------------------------
Key: DNET-604
URL: http://tracker.firebirdsql.org/browse/DNET-604
Project: .NET Data provider
Issue Type: Improvement
Components: ADO.NET Provider
Affects Versions: 4.6.2.0
Reporter: Pascal
Assignee: Jiri Cincura
When FirebirdSql.Data.FirebirdClient is used to insert a lot of records in a table using parametred query, it's possible to gain time in the FbCommand.UpdateParameterValues :
Change this code :
for (int i = 0; i < this.statement.Parameters.Count; i++)
{
index = i;
if (this.namedParameters.Count > 0)
{
index = this.Parameters.IndexOf(this.namedParameters[i]);
if (index == -1)
{
throw new FbException(String.Format("Must declare the variable '{0}'", this.namedParameters[i]));
}
}
by this one :
for (int i = 0; i < this.statement.Parameters.Count; i++)
{
index = i;
if (this.namedParameters.Count > 0)
{
if (this.Parameters[i].ParameterName != this.namedParameters[i]) // Added by webpac
{
index = this.Parameters.IndexOf(this.namedParameters[i]);
if (index == -1)
{
throw new FbException(String.Format("Must declare the variable '{0}'", this.namedParameters[i]));
}
}
}
And then, if the namedParamers[i] is the same then Parameters[i], it doesn't looking for all nameParameters.
I tried to insert 1000 records with 50 parameters, without the optimisation, it dures 10 seconds and with the optimisation it dures 7 seconds.
Regards,
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|