Advertisement

11.18.2008 at 08:06AM PST, ID: 23914654
[x]
Attachment Details

sql tunning

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.3
Zone:

Oracle 10.x

Tags:

Oracle, Oracle Enterprise Edition RDBMS 10g, 10.1.0.4

I am trying to tune the following query.. Can you make any recommendations.... I am getting 2 full table scans on the payment table and the claim_form table. Indexes do exist, but are not being used...

SELECT  A.PMT_CHEQUE_NO,
       A.PMT_EFT_NO,
       A.BA_LETTER_CD,
       A.ROW_EFF_DT,
       A.STATUS_TYPE_CD,
       A.PMT_LUPD_OPER_CD,
       A.REASON_CD,
       B.CF_CLAIM_FORM_ID,
       C.CODE_VALUE_DESC,
       D.BA_DESC
FROM  PROD.PAYMENT A,
      PROD.PAYMENT_DETAIL B,
      PROD.APP_CODE_VALUE_DESC C,
      PROD.BANK_ACCOUNT D
WHERE  A.STATUS_TYPE_CD = 'SP'
      AND A.ROW_EXP_DT IS NULL
      AND A.DELETE_DT  IS NULL
      and a.BA_BANK_ID = d.BA_BANK_ID
      and d.ROW_EXP_DT is null
      and d.DELETE_DT is null
      AND C.CODE_VALUE_CD = A.REASON_CD
      AND C.CODE_TYPE_CD = 'REASON_CD'
      AND A.PMT_PAYMENT_ID = B.PMT_PAYMENT_ID
      AND B.Delete_Dt   IS NULL
      AND A.BA_BANK_ID = D.BA_BANK_ID
      AND C.CODE_VALUE_LANG_CD = 'ENG'
      AND NOT EXISTS (SELECT 1 FROM PROD.CLAIM_FORM e
                       WHERE B.CF_CLAIM_FORM_ID = e.CF_CLAIM_FORM_ID
                           AND e.REVISION_NO > b.CLAIM_FORM_REVISION_NO )
     AND NOT EXISTS (SELECT 1 FROM PROD.CLAIM_FORM f, prod.payment_detail pd2
                       WHERE a.pmt_payment_id = pd2.pmt_payment_id
                                                  AND f.revision_no > pd2.CLAIM_FORM_REVISION_NO
                                        AND f.cf_claim_form_id = pd2.cf_claim_form_id
                                                  AND f.CLAIM_TRANS_TYPE_CD = 'AJ'
                                        AND f.delete_dt IS NULL
                                        AND f.row_exp_dt IS NULL );
Answered By: richard_crist
Expert Since: 09/16/2008
Accepted Solutions: 16
Computer Expertise: Advanced
Education: David Lipscomb Universitynull, Bachelor's Degree
richard_crist has been an Expert for 3 months, during which he has posted 69 comments and answered 16 questions. richard_crist is just one of 761 experts in the Oracle 10.x Zone. 2 experts collaborated on this answer, which was graded a "B" by the asker.
 
 
20081119-EE-VQP-47 - Hierarchy / EE_QW_2_20070628