If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > tune the query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-17-09, 10:28
vinay.tanguturu vinay.tanguturu is offline
Registered User
 
Join Date: Jun 2009
Posts: 2
tune the query

Hi,
Is there a possibility to tune the below query..


select a.lv10_name,a.lv10_number,a.lv09_name,a.lv09_numbe r,a.lv08_name,a.lv08_number,a.lv07_name,a.lv07_num ber,a.lv06_name,a.lv06_number,a.lv05_name,a.lv05_n umber,a.lv04_name,a.lv04_number,a.lv03_name,a.lv03 _number,a.lv02_name,a.lv02_number,a.store_number,b .associate_nbr,b.key_perf_ind_id,b.report_id,b**** n_id,b.report_user_id,b.org_id,b.associate_id,b.be gin_date,b.end_date,b.actual_perf_criteria,b.value _type,b.create_message,b.message_count,b.role_assi gn,b.mess_staged,b.mess_sent,b.default_role_mess_i d,b.copy_role_mess_id,b.std_dev_z_score,b.associat e_last_name,c.key_perf_ind_desc,c.evaluation_perio d_type,c.support_format,c.kpi_dept_nbr,c.key_perf_ ind_level_type,c.kpi_canned,c.kpi_actual,c.kpi_sum mary_tbl,c.kpi_denom,b.exception_type,a.org_number ,a.store_org_id,f.report_description,b.actual_perf _criteria
from kcpos_organization_master a,
kcrei_key_performance_mess b left outer join kcrei_report_history f on b.report_user_id = f.user_id and b.report_id = f.report_id and b****n_id = f****n_id ,
key_performance_ind c
where (a.store_org_id = b.org_id and b.key_perf_ind_id = c.key_perf_ind_id) and (( b.org_id = ? and b.user_id = ? )) order by c.key_perf_ind_level_type desc,a.lv10_number asc,a.lv09_number asc,a.lv08_number asc,a.lv07_number asc,a.lv06_number asc,a.lv05_number asc,a.lv04_number asc,a.lv03_number asc,a.lv02_number asc,a.store_number asc,b.associate_nbr asc,c.key_perf_ind_desc asc
Reply With Quote
  #2 (permalink)  
Old 06-17-09, 10:30
vinay.tanguturu vinay.tanguturu is offline
Registered User
 
Join Date: Jun 2009
Posts: 2
order of execution

Can you please explain the order of execution for the below query..


select a.lv10_name,a.lv10_number,a.lv09_name,a.lv09_numbe r,a.lv08_name,a.lv08_number,a.lv07_name,a.lv07_num ber,a.lv06_name,a.lv06_number,a.lv05_name,a.lv05_n umber,a.lv04_name,a.lv04_number,a.lv03_name,a.lv03 _number,a.lv02_name,a.lv02_number,a.store_number,b .associate_nbr,b.key_perf_ind_id,b.report_id,b**** n_id,b.report_user_id,b.org_id,b.associate_id,b.be gin_date,b.end_date,b.actual_perf_criteria,b.value _type,b.create_message,b.message_count,b.role_assi gn,b.mess_staged,b.mess_sent,b.default_role_mess_i d,b.copy_role_mess_id,b.std_dev_z_score,b.associat e_last_name,c.key_perf_ind_desc,c.evaluation_perio d_type,c.support_format,c.kpi_dept_nbr,c.key_perf_ ind_level_type,c.kpi_canned,c.kpi_actual,c.kpi_sum mary_tbl,c.kpi_denom,b.exception_type,a.org_number ,a.store_org_id,f.report_description,b.actual_perf _criteria
from kcpos_organization_master a,
kcrei_key_performance_mess b left outer join kcrei_report_history f on b.report_user_id = f.user_id and b.report_id = f.report_id and b****n_id = f****n_id ,
key_performance_ind c where (a.store_org_id = b.org_id and b.key_perf_ind_id = c.key_perf_ind_id) and (( b.org_id = ? and b.user_id = ? )) order by c.key_perf_ind_level_type desc,a.lv10_number asc,a.lv09_number asc,a.lv08_number asc,a.lv07_number asc,a.lv06_number asc,a.lv05_number asc,a.lv04_number asc,a.lv03_number asc,a.lv02_number asc,a.store_number asc,b.associate_nbr asc,c.key_perf_ind_desc asc





is it simple join with a and b and result set of this simple join with c and result set of this left outer join with f.
here a,b,c,f are alliases.
Reply With Quote
  #3 (permalink)  
Old 06-17-09, 15:59
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Quote:
Originally Posted by vinay.tanguturu
Can you please explain the order of execution for the below query..
You have to have either Visual Explain or db2expln tell you this.

What is your DB2 version and OS?

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On