| optimisation [message #427169] |
Wed, 21 October 2009 07:07  |
rajasekhar857 Messages: 416 Registered: December 2008 |
Senior Member |
|
|
Below is the buffer_get and execution details for oracle database, which is time
consuming during
load.
BUFFER_GETS 139392
EXECUTIONS 1584
BUFFER_GETS/EXECUTIONS
88
Below is the query
SELECT DISTINCT
ECD.CONSULTANT_ID, ECD.CONSULTANT_NAME
FROM EMRConsultantDetails ECD
INNER JOIN Users USR ON
USR.USER_LOGIN = ECD.CONSULTANT_ID
INNER JOIN EMRUserRoleLocation EURL ON EURL.USER_LOGIN =
ECD.CONSULTANT_ID
WHERE USR.USER_STATUS = 'active' AND EURL.LOCATION_ID = 1501
ORDER BY
ECD.CONSULTANT_NAME
any other possibility of optimisation
|
|
|
|
| Re: optimisation [message #427172 is a reply to message #427169] |
Wed, 21 October 2009 07:10   |
Its_me_ved Messages: 127 Registered: October 2009 Location: India |
Senior Member |
|
|
rajasekhar857 wrote on Wed, 21 October 2009 07:07
any other possibility of optimisation
Read the Performance Tuning sticky in the performance tuning section.
1. Make sure that statistics are upto date
2. Please provide the show plan for the sql
3. Also what are the indexes for the tables used in the sql
4. How many rows are there in each table
Thanks
|
|
|
|
|
| Re: optimisation [message #427191 is a reply to message #427188] |
Wed, 21 October 2009 08:40   |
Michel Cadot Messages: 29425 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
What I meant is that he already knows the information that are required, needed and requested for such a question...
Regards
Michel
|
|
|
| Re: optimisation [message #427194 is a reply to message #427169] |
Wed, 21 October 2009 08:59   |
JRowbottom Messages: 5362 Registered: June 2006 Location: Sunny North Yorkshire, ho... |
Senior Member |
|
|
That's 88 buffer gets per execution.
For a 3 table query, presumably using indexed lookups, and returning multiple duplicate rows (otherwise why would you need a distinct) that's probably not far off as good as you'll get.
You get more help when you've confirmed that the stats are up to date, posted and explain plan and detaqils of the indexes on the tables.
|
|
|
|
| Re: optimisation [message #429800 is a reply to message #427169] |
Thu, 05 November 2009 17:53  |
 |
Kevin Meade Messages: 1050 Registered: December 1999 |
Senior Member |
|
|
try reformulating as two correlated subqueries. This will get rid of the distinct and remove the need to visit all rows in all three tables. You should see dramatic increase in performance as long as the correlated columns are indexed appropriately.
Kevin
|
|
|