I have a Microsoft SQL Server 2008 instance and Oracle 10g database installed side by side on the same remote server with the same exact data loaded in each.
I’ve written a program to time a simple query which return about 10,000 records (SELECT * FROM TABLE WHERE X=X). What I’m seeing through this test is Oracle returns anywhere from 4-12 times slower than MSSQL. I’ve tested on a LAN connection, remotely through VPN, using ODP.NET4, ODP.NET2, ensuring the proper 32 bit version is installed on a 32 bit operating system, and the same for 64 bit.
My results are always the same in that Oracle is always many times slower than the SQL Server instance.
I’ve also tried the same query inside SQL Developer, and this tool retrieves the same recordset much faster. When I force the tool to retrieve all records it comes through about 20% slower than SQL Server, which would at least be acceptable in my scenario.
Any help is appreciate. I know there are several similar questions but the answers from these have not helped resolve the problem.
Thanks
- From database server: 3s (Oracle) vs 0.6s (SQL Server)
- From somewhere in lan: 22s (Oracle) vs 4s (SQL Server)
- From remote machine through vpn: 54s (Oracle) vs 21s (SQL Developer) vs 13s (SQL Server)
Additional question: Is this the performance hit that you experience in your ODP.NET + SQL Server compliant applications, or am I right to assume that something is wrong?
Are you setting a fetch size in your application? If so, have you tried setting different fetch sizes and measuring how that affects the elapsed time? I believe SQL Developer defaults to a fetch size of 500 (though I don’t by any stretch guarantee that) so you might use that as a starting point.