Need a simple CRM and Project Management system?
Check out JobNimbus - CRM for Contractors and Service Professionals.

Performance benchmarks for ODBC vs. Oracle, MySql, SQL Server .NET Providers

I did a simple benchmark for the 3 main databases (Oracle 11g, MySQL 5.1, SQL Server 2008) to see how using ODBC compares to using their native providers in .NET for all database access. To keep things on an even playing field, all 3 databases were run on the same machine, with the exact same database name, table name, and schema. Database authenticaton was used by all databases.

This is a follow-up to the Performance benchmarks for LINQ vs. SqlDataReader, DataSet post where I tested different data access methods. Here I just used DataReaders for all database access because it is the fastest and put all access on even footing. I have put up the code here (which was adapted from the previous benchmarks) so you can see my methodology:



  Benchmarker_Providers

Here are the results:

 
******************************
Run : 1
******************************
Oracle ODBC: 4,822 ms
Oracle .NET: 1,158 ms
MySQL ODBC: 1,800 ms
MySQL .NET: 1,356 ms
SQL Server ODBC: 955 ms
SQL Server .NET: 470 ms
 
******************************
Run : 2
******************************
Oracle ODBC: 4,786 ms
Oracle .NET: 994 ms
MySQL ODBC: 1,914 ms
MySQL .NET: 1,216 ms
SQL Server ODBC: 888 ms
SQL Server .NET: 517 ms
 
******************************
Run : 3
******************************
Oracle ODBC: 4,623 ms
Oracle .NET: 981 ms
MySQL ODBC: 1,914 ms
MySQL .NET: 1,213 ms
SQL Server ODBC: 926 ms
SQL Server .NET: 457 ms
 
-------------------------------------------------------------------
Data Access Type    Run 1    Run 2    Run 3    Average
-------------------------------------------------------------------
Oracle ODBC        4,822    4,786    4,623    4,743
Oracle .NET        1,158    994    981    1,044
MySQL ODBC        1,800    1,914    1,914    1,876
MySQL .NET        1,356    1,216    1,213    1,261
SQL Server ODBC        955    888    926    923
SQL Server .NET        470    517    457    481
 
-------------------------------------------------------------------
Oracle .NET Provider
-------------------------------------------------------------------
454.31% faster than Oracle ODBC
 
-------------------------------------------------------------------
MySQL .NET Provider
-------------------------------------------------------------------
148.77% faster than MySQL ODBC
 
-------------------------------------------------------------------
SQL Server .NET Provider
-------------------------------------------------------------------
191.89% faster than SQL Server ODBC

 

As you can see, using the .NET Native Provider for the database you are connecting to makes a HUGE difference. I avoid ODBC for any high performance system because its convenience in multiple database connections can't cancel out its severe performance limitations on many systems.