views:

817

answers:

1

I was wondering what were the hidden performance implications of using the Database object in the Enterprise Library. I have an OleDbCommand (type=stored procedue) that is calling an IBM iSeries stored procedure that is taking anywhere from 1.5 to 4.5 minutes to complete.

If I manually run the sproc using the iSeries tools and similar parameters then it takes about 5 secs. So the performance slowdown is either in the network communication to the iSeries or something hidden within the Database object within the Enterprise library. Just looking for any ideas.

m_asi = DatabaseFactory.CreateDatabase("ASI-TEST");
using (var cmd = new OleDbCommand())
{
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.CommandText = string.Format("{0}.P_VNDR_INV", m_strASISprocCatalog);
    cmd.Parameters.Add("@RUN_ENV", OleDbType.Char, 1).Value = strEnvironmentCode;
    cmd.Parameters.Add("@SIS_KEY", OleDbType.Char, 36).Value = InvFilter.SISKey;
    cmd.Parameters.Add("@FROM_DTE", OleDbType.Char, 8).Value = InvFilter.CheckDateFrom.ToString("yyyyMMdd");
    cmd.Parameters.Add("@TO_DTE", OleDbType.Char, 8).Value = InvFilter.CheckDateTo.ToString("yyyyMMdd");
    cmd.Parameters.Add("@EXT_Y", OleDbType.Char, 1).Value = (InvFilter.IsExternal ? "Y" : "N");
    cmd.Parameters.Add("@INC_Y", OleDbType.Char, 1).Value = (InvFilter.IncludeASI ? "Y" : "N");
    cmd.Parameters.Add("@VND_ID", OleDbType.Char, 1800).Value = InvFilter.GetVendorQueryString(18, 1800);

    // This call is the bottleneck
    m_asi.ExecuteNonQuery(cmd);
}
+1  A: 

I would expect it to be some bizarre setting that is different from the iSeries tools and the .NET client - for example:

  • transaction mode?
  • ansi settings?
  • other connection options? (for SQL Server, I'd mean things like SET CONCAT_NULL_YIELDS_NULL, etc)

I don't know much about iSeries, but with SQL Server, for example, it can only use "indexed persisted calculated" columns if everything is just right; otherwise it re-computes the formula per row.

Have you tried a trace?

Marc Gravell
all very good ideas to look at. I will take a look at these. +1 for giving me some ideas.
Jon Erickson