Results 1 to 3 of 3

Thread: tune the query

  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Unanswered: 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

  2. #2
    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.

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •