2 Replies Latest reply on Jul 11, 2013 1:22 AM by Alex Keh - Product Manager-Oracle

    Very slow select query by ODP.NET

    Nistix

      Trying very simple C# code:

       

      ....

      using Oracle.ManagedDataAccess.Client;

      using Oracle.ManagedDataAccess.Types;

      ....

      OracleConnection con;

      OracleCommand cmd;

      OracleDataReader dr;

      con = new OracleConnection(constr);

      con.Open();

      cmd = new OracleCommand();

      cmd.Connection = con;

      cmd.CommandText = "select id from ttuser.accounts where id = '1231231231'";

      cmd.CommandType = CommandType.Text;

      dr = cmd.ExecuteReader();

      dr.Read();

      this.label1.Text = dr.GetString(0);

       

      BUT code executes in 20-30 seconds !!!

      When I do the same query in Toad for Oracle, for example, it takes less than 1 second !

      The same query, using cx_oracle in Python finish in 1-2 second only !

       

      Table ACCOUNTS has index on column ID, but column is VARCHAR2

      Why Oracle.ManagedDataAccess takes so much time to execute ?