Solved

need help on explain plan oracle sql

Posted on 2014-03-10
3
510 Views
Last Modified: 2014-03-23
Hi ,

Iam new to sql tuning , I have been asked to run an explain plan for an query and provide possible solutions for tuning thehelp  query

I need help on reading and analyzing the explain plan, below is  the output of my plan table , any help in explaining the plan is very much appreciated.

Attached is   the  plan . Kindly help me in understanding the output.
sql1.txt
0
Comment
Question by:sam_2012
[X]
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
3 Comments
 
LVL 35

Assisted Solution

by:johnsone
johnsone earned 167 total points
ID: 39917185
In addition to the plan, the query would be very useful.

Based on the plan, you should be able to see that you are using no indexes at all.  As a first guess, I would be looking at putting an index on CONTACT.VISRES_ID.  You should also have indexes on all the join fields.

There also seems to be a lot of outer joins in your query.  Are those really necessary?
0
 
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 166 total points
ID: 39917205
you're basically selecting the first 25 rows from a view
there are no indexes used on any table as it's always a TABLE ACCESS FULL

my guess is there are no indexes on the table on the joined fields

in the explain plan: by optimizer calculations on stats
the rows column indicates how many rows of data will probably match that condition
the bytes indicates what volume this is

the TABLE ACCESS FULL indicates it has to read the complete table
> looks like you have a few million rows in each

the HASH JOIN indicates how the matching is done for each row

there are multiple times the same FULL table scan on the same tables
> CONTACT, USERDETAILS, CONTACTDETAILS, USERDETAILS_LOG ...
sometimes it's possible to avoid muliple reads on the same table by somewhat rewriting the query

without the query ... it's difficult to see that
0
 
LVL 6

Accepted Solution

by:
Javier Morales earned 167 total points
ID: 39917451
Yes,

the join with the view (24GB) really makes the cost raise up to 2Million cost units. You can see the time is going to 1minute 14seconds.

Here is the big cost. Check the filters on the view and make it use any indexes to make the 4 and half milion of rows of USERDETAILS lighten the weight.

Hope it helps.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

752 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