They are able to upload 30,000 record an hour using this process.
OK, something is VERY wrong. Granted, it's a contrived example (and
.NET), but I'm getting an effective rate of 1.5 Million rows per hour
from my laptop to our 270. Code and results below...
100000 rows...
Runtime: 00:03:57.6850946
Rows per second: 420.72
Rows per minute: 25,243.48
Rows per 15-minute: 378,652.27
Rows per hour: 1,514,609.07
---Begin Code---
using System;
using System.Collections.Generic;
using System.Text;
using IBM.Data.DB2.iSeries;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
iDB2Connection cn = new
iDB2Connection("DataSource=SOL;UserID=WaldenL;Password=xxx;Naming=System
;LibraryList=QTEMP,WALDENL,QGPL");
cn.Open();
Console.WriteLine(cn.JobName);
iDB2Command cm = cn.CreateCommand();
cm.CommandText = "insert into waldenl/test
(fld1, fld2) values(?, ?)";
cm.Parameters.Add(new iDB2Parameter("fld1",
iDB2DbType.iDB2Integer));
cm.Parameters.Add(new iDB2Parameter("fld2",
iDB2DbType.iDB2Char, 30));
int rows = 100000;
DateTime start = DateTime.Now;
for (int i = 1; i <= rows; i++)
{
cm.Parameters["fld1"].Value = i;
cm.Parameters["fld2"].Value =
string.Format("String {0}", i);
cm.ExecuteNonQuery();
if (i % 100 == 0)
Console.WriteLine(i);
}
DateTime stop = DateTime.Now;
TimeSpan runTime = stop - start;
Console.WriteLine(string.Format("Runtime: {0}",
runTime));
double rowsPerSecond =
rows/runTime.TotalSeconds;
Console.WriteLine(string.Format("Rows per
second: {0:n}", rowsPerSecond));
Console.WriteLine(string.Format("Rows per
minute: {0:n}", rowsPerSecond*60));
Console.WriteLine(string.Format("Rows per
15-minute: {0:n}", rowsPerSecond*60*15));
Console.WriteLine(string.Format("Rows per hour:
{0:n}", rowsPerSecond*60*60));
Console.ReadLine();
cn.Close();
return;
}
}
}
----End Code----
As an Amazon Associate we earn from qualifying purchases.