2

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);
}
4

1 に答える 1

1

iSeries ツールや .NET クライアントとは異なる奇妙な設定になると思います。たとえば、次のようになります

  • 取引モード?
  • アンシ設定?
  • 他の接続オプション?(SQL Server の場合は、SET CONCAT_NULL_YIELDS_NULL などを意味します)

私は iSeries についてあまり知りませんが、たとえば SQL Server では、すべてが適切な場合にのみ、「インデックス付きの永続的な計算」列しか使用できません。それ以外の場合は、行ごとに式を再計算します。

トレースを試しましたか?

于 2009-01-30T23:21:54.823 に答える