Poor performance with OracleDataReader

I experience terrible performance when reading data from an OracleDataReader object compared to MS SQL Server. This is almost 10 times slower, which is unacceptable.

The following is an example test code example that both tests use. What is the best way to read data from OracleDataReader, is there a better way than shown below?

It’s not easy for me to believe that ODP.Net cannot compare with SqlClient.

UPDATE: I reduced the problem to getting text fields. For some reason, ODP.Net is terrible at that. Any ideas how to fix this?

void ReadData(System.Data.IDataReader dr, int maxRows)
 {
     ArrayList rows = new ArrayList(maxRows > 0 ? maxRows : 1000);

     object[] row;

     int rowsRead = 0;
     while (dr.Read() && ((maxRows == -1) || (rowsRead++ < maxRows)))
     {
         row = new object[dr.FieldCount];
         dr.GetValues(row);

         rows.Add(row);
     }
     rows.Clear();
 }

Note (s):

  • I tried to experiment with FetchSize, did not experience much difference

  • The query execution time is not a problem here, but only a data search.

  • The data structures in both databases are identical.

  • DataAdapter/DataSet .

+3
1

CLOB nvarchar (MAX).

Oracle , OCI CLOB. CLOB , BLOB. , .. , , ~ 200 char. , LOBFetchSize -1. , CLOB . , .

, . OCI 11.2. 11.2, , 32, 64- .

, LOBFetchSize -1 .

+3

Source: https://habr.com/ru/post/1731971/


All Articles