Re: Performance problems with OracleDataReader



It has to do with how the data in each row is addressed. If you use an
ordinal, the addressing is simple to resolve. If not the class has to search
the list of columns (each time) and determine if the string provided is a
match. It can take 10 times longer to resolve using strings.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Henning Fiese" <henning.friese@xxxxxx> wrote in message
news:1175779912.405410.300370@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Bill,

thanks for your answer. Im not interested in using DataTables, i just
want to copy the contents of the reader to the corresponding member
fields of the objects. Using the OracleDataReader's int-indexer
instead of the string-indexer doesnt't seem to affect performance at
all.

Im just wondering why the access of the OracleDateReader's indexer is
so slow. The actual transfer of the data (from the db to the client)
is performed within the Read()-method, isn't it? What is happening
within those indexers that is so time-consuming?

Best regards
Henning


On 4 Apr., 19:02, "William \(Bill\) Vaughn"
<billvaRemoveT...@xxxxxxxxx> wrote:
If the purpose of the code is to build a DataTable, then use
DataTable.Load
method.
Yes, referencing the columns by ordinal is far faster than using strings.
You might also investigate other data providers. Data Direct has a
well-respected provider that's supposed to be faster.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speakerwww.betav.com/blog/billvawww.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visitwww.hitchhikerguides.netto get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Henning Fiese" <henning.fri...@xxxxxx> wrote in message

news:1175694990.372432.310140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hello NG,

I'm using the Oracle Data Access Components and I've encountered
serious performance problems with the OracleDataReader. The following
function fills the memberfields of an object with the content of a
reader:

internal void FillFromReader(IDataReader Reader)
{
m_id = (int)Reader["id"];
m_name = (string)Reader["name"];
// ... ~ 20 more lines of this...
}

Note that the call to Reader.Read() is made outside the function. With
the OracleDataReader this function needs an average of 2000 ticks to
complete. With the SQLDataReader, it needs only about 150 ticks.

What am I doing wrong? Is this a problem with the configuration of the
client or the dbms? Or is there a better way to implement
FillFromReader()?

Cheers
Henning




.



Relevant Pages

  • Re: What are OleDbParameter names with Original_ prefix?
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... Since the table has a primary key column, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ADO.NET Transaction
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... Client transactions put too much schema-dependent, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Very slow
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ...
    (microsoft.public.sqlserver.ce)
  • Re: ADO.NET Transaction
    ... The SqlBulkCopy class can take anything you can expose with a DataReader and send it to SQL Server in a single high-speed operation. ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... Client transactions put too much schema-dependent, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Replacing tables in SQL EXPRESS
    ... I have posted an updated example on the Hitchhiker's Guide support site. ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... > SQL EXPRESS database file? ...
    (microsoft.public.dotnet.framework.adonet)