Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Oracle Query Slow with C#

Posted on 2010-11-28
3
1,510 Views
Last Modified: 2012-05-10
Dear experts,

I wrote a C# program connecting to a huge Oracle table (500 GB or more) and making a select query. The Oracle table is well designed and uses indexes. The problem is that the query returns the result set very slow. It takes approximately 7-8 min. However, when I run the same query in Toad, it takes 20 seconds. (Auto-trace is set, all the results are being fetched) I tried ODP.Net, again it did not make sense.

How can I keep up with this performance issue? Any recommendation welcomes. Even you can offer me a solution through different programming languages.

BR,
0
Comment
Question by:GurcanK
3 Comments
 
LVL 5

Accepted Solution

by:
roxviper earned 200 total points
ID: 34224501
0
 
LVL 7

Assisted Solution

by:jocave
jocave earned 200 total points
ID: 34224988
Are you certain that the query being executed in Toad is actually identical?  Are you using bind variables in the C# application, for example, while you are using literals in Toad?  Are you certain that there are no formatting differences between the queries?  If you are generating the same SQL_ID from both Toad and your application, are you seeing multiple query plans for that SQL_ID in the shared pool?

How much data are you fetching from Oracle?  I'm assuming you're not selecting the entire 500 GB.  But are you selecting thousands or millions of rows?  Or are you selecting dozens of rows?

0
 
LVL 3

Assisted Solution

by:abdkhlaif
abdkhlaif earned 100 total points
ID: 34225179
Are you using System.Data.OracleClient? DataSet?
Attach the code
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

809 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