473,789 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help to fine tune below query..urgent please.

3 New Member
Query used in cursor:

DECLARE CURSOR2 CURSOR FOR
SELECT TDET_DET_PAR_NB R
,TDET_SYS_ID
,TDET_DR_CR_IND
,TDET_DET_AMT
,TDET_DIST_SETT _DTE
,TDET_FILE_ID_N BR
,TDET_CBAT_ID_N BR
,TDET_FILE_COL_ DTE
,TDET_FILE_SYS_ ID
,TDET_ACH_TRAN_ CD
,TDET_INDV_INFO _TXT
,TDET_DIST_ACCT _NBR
,TDET_ORIG_ACCT _NBR
,TDET_SEC_CD
,TDET_DET_PAR_D TE
,CBAT_HDR_CO_ID
FROM CH_P_TRANDET, CH_P_COLL_BTCH
WHERE TDET_DET_PAR_NB R = :TDET-DET-PAR-NBR
AND TDET_SYS_ID = :TDET-SYS-ID
AND TDET_DR_CR_IND = :TDET-DR-CR-IND
AND TDET_DET_AMT = :TDET-DET-AMT
AND TDET_DIST_SETT_ DTE >= :TDET-DIST-SETT-DTE
AND TDET_FILE_ID_NB R = CBAT_FILE_ID_NB R
AND TDET_CBAT_ID_NB R = CBAT_ID_NBR
AND TDET_FILE_COL_D TE = CBAT_FILE_COL_D TE
AND TDET_FILE_SYS_I D = CBAT_FILE_SYS_I D
AND TDET_FILE_TYPE_ CD = CBAT_FILE_TYPE_ CD
AND TDET_FILE_SYS_I D = CBAT_FILE_SYS_I D
AND CBAT_HDR_CO_ID = :CBAT-HDR-CO-ID
--> ORDER BY TDET_DIST_SETT_ DTE
FOR FETCH ONLY END-EXEC. "

INDEX DETAILS.

Table CH_P_TRANDET indexes:

X1CHTDET (UNIQUERULE R)

TDET_DET_PAR_NB R
TDET_SYS_ID
TDET_DET_PAR_DT E

X2CHTDET (UNIQUERULE U)

TDET_CBAT_ID_NB R
TDET_FILE_ID_NB R
TDET_FILE_COL_D TE
TDET_FILE_TYPE_ CD
TDET_FILE_SYS_I D
TDET_SYS_ID
TDET_DET_PAR_DT E
TDET_DET_PAR_NB R
TDET_EXCP_STAT_ CD

"Table CH_P_COLL_BTCH indexes:

X1CHCBAT (UNIQUERULE P)

CBAT_ID_NBR
CBAT_FILE_ID_NB R
CBAT_FILE_COL_D TE
CBAT_FILE_TYPE_ CD
CBAT_FILE_SYS_I D

X2CHCBAT (UNIQUERULE U)

CBAT_POINT_NME
CBAT_FILE_SYS_I D
CBAT_FILE_COL_D TE
CBAT_FILE_ID_NB R
CBAT_ID_NBR
CBAT_FILE_TYPE_ CD
CBAT_COLL_APPL_ ID
CBAT_COLL_TYPE_ CD

X3CHCBAT (UNIQUERULE U)

CBAT_HDR_CO_ID
CBAT_FILE_SYS_I D
CBAT_FILE_COL_D TE
CBAT_FILE_ID_NB R
CBAT_ID_NBR
CBAT_FILE_TYPE_ CD
CBAT_HDR_EFF_DT E
CBAT_SRCE_CD "
Aug 3 '07 #1
2 1768
cburnett
57 New Member
Difficult to do without some stats. It would appear that a 2-column matching index scan on X1CHTDET is the most probable access path with a nested loop join to CH_P_COLL_BTCH using X1CHCBAT.

Changing X1CHTDET and adding DR_CR_IND, TDET_DET_AMT and DET_DIST_SETT_D TE as the 3rd, 4th and 5th columns (before TDET_DET_PAR_DT E) would improve selectivity of the index but this may not be an option.

Ensure runstats has been run on the tables and indexes and run db2expln on this statement.
Aug 3 '07 #2
chandra131
3 New Member
Thank you..i will come back with EXPLAIN report..Thank you for your reply..
Aug 3 '07 #3

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

Similar topics

4
1600
by: phillip.s.powell | last post by:
UPDATE redesign.student SET student_work_area_other SELECT REPLACE('anywhere,(.*)', '$1', i.work_area) AS regexp_col FROM mycompany.interns i, redesign.student s WHERE i.unique_key = s.unique_key GROUP BY work_area Of course this does not work, but I have no idea what the MySQL equivalent will be to something like this. I basically want to take out PART of a column field value and update it
2
1727
by: deependrapathak | last post by:
Hi All, I am currently facing a crutial problem in Access2003 in Windows XP on just 3 PCs, the Application throws some of the errors specified below : 1. Error Number : 3075 Function is not available in expressions in query expression 'Format(,"$#,##0.00")' . 2. On Click Error : The expression you entered refers to an object that is closed or doesn't exist. 3. On Click Error : Function is not available in expressions in query...
8
2391
by: rshivaraman | last post by:
Hi : I have a TableA with around 10 columns with varchar and numeric datatypes It has 500 million records and its size is 999999999 KB. i believe it is kb i got this data after running sp_spaceused on it. The index_size was also pretty big in 6 digits. On looking at the tableA
1
1707
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: id ------------ name
1
1549
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: ----------------
1
1271
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: ----------------
0
1143
by: chandra131 | last post by:
Hello, Thankyou for helping me. Here we have two quires on same table , but FROM classs differs. But both quiries uses the same INDEX.I have provided the index details below.Is there any chances to improve performance. Please help me. Thank you. STATEMENET :1 ---------------------------
1
4390
by: veerunrt | last post by:
Hi All, one column is having no of values separated by comma in the table that any one value should match with some other column of another table one value how to join in oracle I need result for this query: SELECT DISTINCT oeh.ORDER_NUMBER AS sales_order_number, oeh.REQUEST_DATE AS CUST_REQ_DATE,
5
2166
by: Justin | last post by:
Here's my XML: <?xml version="1.0" ?> <AppMode Type="Network"> <CurrentFolder Path="c:\tabs"> <Tabs> <FilePath>tabs\Justin.tab</FilePath> <FilePath>tabs\Julie.tab</FilePath> *****There could be 1 of these or 100....quantity can change***** </Tabs>
0
9663
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9506
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10193
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.