Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

need help on explain plan oracle sql

Posted on 2014-03-10
3
Medium Priority
?
521 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 501 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 38

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 498 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 7

Accepted Solution

by:
Javier Morales earned 501 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

718 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