Performance difference of same query in 2 database [message #561713] |
Tue, 24 July 2012 23:50 |
sasnrock
Messages: 19 Registered: August 2007
|
Junior Member |
|
|
Hi,
We have 2 database. One is the main DB and other is its replica used for reporting purpose.
We are running a query in the main database, its returning the output in few millisec (~150-200ms). However, when I executed the same query in the reporting DB, its taking more than 2 secs.
I compared the execution plan in both the database and the plan is exactly the same (including cost, bytes).
I checked this even during the off peak time considering might be problem due to huge load on reporting DB.
Could you please let me know what else can be checked as we have a requirement that the query output should be returned in less than 1sec.
I'm not sure if the above information is enough. But appreciate any inputs so that it will be helpful in analysing further.
Thanks
|
|
|
|
Re: Performance difference of same query in 2 database [message #561717 is a reply to message #561714] |
Wed, 25 July 2012 00:05 |
sasnrock
Messages: 19 Registered: August 2007
|
Junior Member |
|
|
Hi,
The reason is, we have a external system that uses the query to produce some output to the customer. Their session will be timed out if they dont get the response within 1 second. Actually this is a SLA where the response time should be less than 1 sec. External systems point to reporting DB and hence we are trying to resolve the issue.
Temporarily, we have created a DB link to main DB to avoid the issue. However, we want to avoid the dblink and run the query directly in the reporting DB.
|
|
|
|
|