473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to improve the performance of the following query?

We have some batch proceeses running.In which we have some driver queries one of the queries is listed below.I am working on the performance improvement of these queries .I have done proper indexing in which performance has been incresed.But we need to furtehr impriove the performance.Can you please suggest me how can i further modify the below query for performance

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT e.ELG_EVNT_ID,
  2.                 e.ELG_ENTITY_ID,
  3.                 e.ELG_DPT_ID,
  4.                 e.PART_ID,
  5.                 e.OU_ID,
  6.                 e.ELG_ACNT_ID
  7.   FROM ELG_ELGBLTY        e,
  8.        NGP_NOTF_GNT_PMTR  n,
  9.        SBD_SYS_BSNS_DTS   s,
  10.        DPT_DPOT_EVNT_DTLS d,
  11.        EDD_EVNT_DT_DTLS   f,
  12.        IAC_IMPCT_ACTN     i
  13.  WHERE e.ELG_ENTITY_ID = d.DPT_ENTITY_ID AND e.ELG_EVNT_ID = d.DPT_EVNT_ID AND
  14.        e.ELG_DPT_ID = d.DPT_DPT_ID AND e.ELG_ENTITY_ID = n.NGP_ENTITY_ID AND
  15.        e.ELG_EVNT_ID = n.NGP_EVNT_ID AND e.ELG_DPT_ID = n.NGP_DPT_ID AND
  16.        e.ELG_ENTITY_ID = s.SBD_ENTITY_ID AND
  17.        e.ELG_ENTITY_ID = f.EDD_ENTITY_ID AND e.ELG_EVNT_ID = f.EDD_EVNT_ID AND
  18.        e.ELG_DPT_ID = f.EDD_DPT_ID AND e.ELG_ENTITY_ID = i.IAC_ENTITY_ID AND
  19.        e.ELG_EVNT_ID = i.IAC_EVNT_ID AND e.ELG_DPT_ID = i.IAC_DPT_ID AND
  20.        e.PART_ID = f.PART_ID AND e.OU_ID = f.OU_ID AND f.STATUS = 'AUTHD' AND
  21.        d.STATUS = 'AUTHD' AND (n.STATUS = 'AUTHRIZE' OR n.STATUS = 'PRCSD') AND
  22.        s.STATUS = 'AUTHRIZE' AND e.ELG_STATUS = 'AUTHRIZE' AND
  23.        s.SBD_BTCH_IND = '0' AND e.ELG_SND_NTFCTN_IND = '1' AND
  24.        n.NGP_NOTF_TYPE = 'PREANNC' AND n.NGP_GNT = '1' AND
  25.        e.ELG_DPT_ACNT_IND = '0' AND i.IAC_ACTN_TYP = 'NEWH' AND
  26.        i.STATUS = 'TBPRCD' AND e.OU_ID = s.OU_ID AND e.OU_ID = n.OU_ID AND
  27.        e.PART_ID = 1 AND e.PART_ID = n.PART_ID AND e.PART_ID = d.PART_ID AND
  28.        e.PART_ID = i.PART_ID AND e.OU_ID = i.OU_ID AND e.ELG_EVNT_ID >= '0000000000' AND
  29.        e.ELG_EVNT_ID <= '9999999999'
  30.  ORDER BY e.ELG_ENTITY_ID, e.ELG_EVNT_ID, e.ELG_DPT_ID
Feb 1 '11 #1
2 1406
mwasif
802 Expert 512MB
Run an EXPLAIN and post the output here.
Feb 2 '11 #2
Please find the output for explain plan

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | B
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 |
| 1 | SORT ORDER BY | | 1 |
| 2 | HASH UNIQUE | | 1 |
| 3 | TABLE ACCESS BY INDEX ROWID | EDD_EVNT_DT_DTLS | 1 |
| 4 | NESTED LOOPS | | 1 |
| 5 | NESTED LOOPS | | 1 |
| 6 | NESTED LOOPS | | 1 |
| 7 | NESTED LOOPS | | 1 |
| 8 | NESTED LOOPS | | 1 |
| 9 | TABLE ACCESS BY INDEX ROWID| IAC_IMPCT_ACTN | 1 |
| 10 | INDEX RANGE SCAN | PERF_IAC_ACTN_TYPE | 1 |
| 11 | TABLE ACCESS BY INDEX ROWID| ELG_ELGBLTY | 1 |
| 12 | INDEX RANGE SCAN | ELG_INDEX_2 | 99 |
| 13 | TABLE ACCESS BY INDEX ROWID | NGP_NOTF_GNT_PMTR | 1 |
| 14 | INDEX UNIQUE SCAN | SYS_C00459902 | 1 |
| 15 | INDEX RANGE SCAN | DPT_INDEX_1 | 1 |

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
| 16 | TABLE ACCESS BY INDEX ROWID | SBD_SYS_BSNS_DTS | 1 |
| 17 | INDEX UNIQUE SCAN | SYS_C00459464 | 1 |
| 18 | INDEX RANGE SCAN | EDD_EVNT_DT_DTLS_INDEX | 1 |
--------------------------------------------------------------------------------
Note
-----
Feb 3 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: James Perry | last post by:
Hi, I have been trying to build an custom report interface for a charity manangement system; which is part of my dissertation. This interface will allow the chairty to input a SQL query and...
2
by: Rob | last post by:
HI, Query from a 9i db. Suggestions? Explain plan cost is 296787. Ouch. Any help would be much appreciated. SELECT WWLINK_THA_DATASET.FX_ID, WWLINK_DIE.UPDATE_DM, WWLINK_DIE.DIAT_ORAT_DT,...
5
by: Brad Parks | last post by:
The following are a few rows in my table: StatedValue VehType Deductible Rate 10000 Truck 1000 9.16 11000 Truck 1000 9.02 12000 Truck 1000...
4
by: Raj | last post by:
Hi all, I have couple of questions some one plzz help 1.I have a query which run for 2 hours on my production machine, it returns 1.5 millon rows, i looked at the explain plan it is picking up...
5
by: reachsamdurai | last post by:
Greetings, I have the following query which takes very long time to execute hence can you please help to fine tune it as I'm new to DB2 World. Thanks SELECT char(VEH_IDENT_NBR) as...
1
by: syl | last post by:
Hi I have a huge loto data and i am trying to come up with the total count of all total combination...the manual process to tiring in excel. e.g the possible combinations range from 1 up to 49. so...
2
by: Haas C | last post by:
Hey all, I created a Query (in Design View) which asks the user for an "As Of Date" which would then display relevant data. I put in the Criteria Row of the Query Design for the Date field. Is...
1
by: Vinod Sadanandan | last post by:
A Roadmap To Query Tuning ============================ For each SQL statement, there are different approaches that could be used to retrieve the required data. Optimization is the process of...
1
by: deepu03 | last post by:
Hi All I have the following query to be tuned.. SELECT distinct a.EMPLID ,a.PER_ORG ,a.HIRE_DT ,a.grade
4
by: sanonward001 | last post by:
Hi, This is regarding the query optimization. T_A table is having rows around 570000, and this query's cost comes out to 202. SELECT COUNT(1) FROM T_A WHERE...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.