Performance comparison ODBC vs. OLE DB

Posted on 2001-08-26
Last Modified: 2013-11-25
Hi.. All..
Pleaze for all experts in DB if you can help in ... i want to know the Performance difference between
ODBC vs. OLE DB in :
i. Various types of recordset.
ii. Various types of database - SQL 7, 2000, Oracle.
iii. Different data types, integer, numeric, string, blob.

So If know about this subject, Pleaze help me, and I need, if there resource exist about this subject,
pleaze provide me ... and How can make the comparison performance programatically ...?

Question by:AAB
LVL 49

Expert Comment

ID: 6425993
xu2000 put some timing stats in this Q:

He had heard that OLEDB should be faster, but his own tests showed that ODBC recordsets were faster.

My thought is that at some point it's the same thing -- the client sends an SQL query string to the server and then processes the returned data.

The throughput bottleneck will *not* be code that wraps that process -- that is lost in the noise on modern computers.  The bottleneck will be network latency and data transport overhead.  Named Pipes with the DB Server on the local PC will be fastest.  Everything else will be slower.

Better to look for performance gains by minimizing the amount of data that goes across the transport.  Use stored procedures when doing so will prevent some data being shuttled back-and-forth.

I think the decision between ODBC and OLE DB boils down to what you find easiest to work with.  OLE DB can be a pain because of all of those BSTRs that need to be converted to CString.  That tips the balance to using simple CRecordsets with an ODBC connection.

Now... Is Oracle faster than Ms SQL?  That depends upon whose press release you read.  I'd be very surprised to find more than 1% difference in performance for most common operations.  But I do admit the possiblility that in some specific rare, borderline situations one performs enough better than another to make a difference.

-- Dan
LVL 32

Expert Comment

ID: 6426745
>>Now... Is Oracle faster than Ms SQL?  That depends upon whose press release you read

Not only that but it also depends on the particular problem you try to test.  Both have their own strengths.  But getting objective benchmark results for either is quite difficult as neither vendor want to permit any bad news from being published about their products.
LVL 32

Expert Comment

ID: 6427040
Didn't you ask this same Q somewhere else also?
LVL 49

Accepted Solution

DanRollins earned 200 total points
ID: 6427146
I think AAB is spreading points around in both MFC and C++ to attract the more/better responses.  I'm all for it, as long as he eventually awards the points in both sections.

-- Dan
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.


Expert Comment

ID: 6431904

Expert Comment

ID: 6434011
I agree with most of the above but it also depends on how you implement your solution.  Using OLEDB consumer templates eases the problem of BSTR's as the templates bind to native data types (TCHARs etc).  Which can help speed.  Also I'm not sure if this is implied but, ADO and OLEDB are different interfaces.  ADO is a wrapper architecture that sits on top of OLEDB.  OLEDB has it's own api that rivals ODBC in terms of performance.  

All in all it really boils down to which technology you are more comfotable developing to.  The performance on each is relatively close.  ADO is the slowest of the bunch, but is the easiest to code to.  The ODBC API can be fast (if you code to native drivers and don't do translation), as can OLEDB if written properly.  Usually the best answer is really based on ones technical skill rather than performance of a technology.  I've seen my share of applications written with ODBC and OLEDB/ADO that run slower than DAO due to poor design and poor skill with those technologies.  
LVL 49

Expert Comment

ID: 6480720
Do you have any additional questions?  Do any comments need clarification?

-- Dan
LVL 23

Expert Comment

by:Roshan Davis
ID: 9528442
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: DanRollins

Please leave any comments here within the next seven days.


Roshan Davis
EE Cleanup Volunteer

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to know only "File created" with EventLog 3 29
ShiftLeft challenge 21 66
scoreUp challenge 14 48
mapAB Challlenge 35 89
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now