Re: Performance problems with OracleDataReader

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



But as I pointed out, it makes no difference which indexer I use, they
are both slow. Besides, mapping a string to an index is a task which
can be performed quite fast, so this shouldn't be the bottleneck.

On 5 Apr., 17:25, "William \(Bill\) Vaughn"
<billvaRemoveT...@xxxxxxxxx> wrote:
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 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: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.nettoget 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: ADO.NET 2.0 saving single space to SQL?
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... > string in 1.1 contain a single space when inserted with 2.0 compiled> code. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: loading stream into datatable.
    ... populate it with the data from the parsed string and add the row to the DataTable Rows collection. ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: nvarchar parameter not truncated based on size of field
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... what's the best practice when assigning strings to parameters? ... check the size of each string before assigning? ... Compact Edition and I'm running into a problem where the ...
    (microsoft.public.sqlserver.ce)
  • Re: ftp.exe problem
    ... > glad, if you guide me. ... >>> Public Sub sFTP(stSCRFile As String) ... >>> The DisplayMessage appear before the ftp process and not ...
    (microsoft.public.access.modulesdaovba)
  • Re: SqlParameter.Size - When to use?
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... Is there an easy way to have the framework determine what the size of the parameter actually is for non-fixed length items (String, text, etc)? ...
    (microsoft.public.dotnet.framework.adonet)