[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/24/2004 at 07:02AM PDT, ID: 21143805
[x]
Attachment Details
[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!

6.2

Make this query run faster

Asked by leonstryker in Databases Miscellaneous

Tags: run, faster, make, query

We are running this query on a DB2 database and are wondering if there is anything which can be done to make it run faster?

with temp(id,desk,CUR_MTD_TOTAL, WTD, CUR_FY_YTD, PRV_MTD_TOTAL, PRV_BUS_DAY,PRV_DAY_AVG, PRV_WEEK_AVG,PRV_MONTH_AVG, PRV_FY_YTD,CUR_REV_ANN,PRV_FY,FORECAST,TOTAL_YTD_ACCRUED, NEXT_PLAN_PRIM,NEXT_PLAN_SECDY,NEXT_PLAN) as (
    select rootoe.row_id,rootoe.name as desk, sum(prev.CUR_MTD_TOTAL), sum(prev.WTD), sum(prev.CUR_FY_REV), sum(prev.PRV_MTD_TOTAL) , sum(prev.PRV_BUS_DAY) , sum(prev.DAILY_AVG) ,sum(prev.WEEKLY_AVG) ,sum(prev.PRV_MONTH_AVG) ,sum(prev.PRV_YTD_REV) ,sum(prev.PRV_FY_REV),sum(prev.CUR_FY_ANN_REV),0,0,0,0,0
    from cx_matrix_pos tr
    inner join cx_revenue prev on prev.postn_id=tr.child_pos
    inner join s_org_ext oe on oe.row_id=prev.oe_id
    inner join s_postn postn on postn.row_id=tr.child_pos
    inner join s_org_ext rootoe on rootoe.row_id=oe.frght_terms_cd
    where tr.parent_pos='1-156J4' and oe.FRGHT_TERMS_INFO like 'Investment Advisor' and Ucase(rootoe.name) like '%'
    group by rootoe.row_id,rootoe.name
    union all
    select rootoe.row_id,rootoe.name as desk,  0,0,0,0,0,0,0,0,0,0,0,sum(bu.forecast),sum(bu.total_ytd_accrued),0,0,0
    from cx_matrix_pos tr
    inner join cx_forecast_fy bu on bu.position_id=tr.child_pos
    inner join cx_fiscal_year fy on fy.fiscal_year=bu.fiscal_year
    inner join s_postn postn on postn.row_id=tr.child_pos
    inner join s_org_ext oe on oe.row_id=bu.ou_id
    inner join s_org_ext rootoe on rootoe.row_id=oe.frght_terms_cd
    where tr.parent_pos='1-156J4' and oe.FRGHT_TERMS_INFO like 'Investment Advisor' and Ucase(rootoe.name) like '%'
    group by rootoe.row_id,rootoe.name
   union all
     select rootoe.row_id,rootoe.name as desk,  0,0,0,0,0,0,0,0,0,0,0,0,0,sum(bu.ni_forecast),sum(bu.sec_forecast),sum(bu.forecast)
    from cx_matrix_pos tr
    inner join cx_forecast bu on bu.position_id=tr.child_pos
    inner join s_period per on per.row_id=bu.period_id
    inner join s_postn postn on postn.row_id=tr.child_pos
    inner join s_org_ext oe on oe.row_id=bu.ou_id
    inner join s_org_ext rootoe on rootoe.row_id=oe.frght_terms_cd
    where tr.parent_pos='1-156J4' and oe.FRGHT_TERMS_INFO like 'Investment Advisor' and Ucase(rootoe.name) like '%'
    and per.desc_text='Fiscal Year 2005'
    group by rootoe.row_id,rootoe.name
)
 select id,desk,  cast(sum(CUR_MTD_TOTAL) as double) as Cur_Month, cast(sum(FORECAST) as double) as Cur_Plan_FY, cast(sum(TOTAL_YTD_ACCRUED) as double) as Cur_Plan_YTD, cast(sum(WTD) as double) as Cur_Week,cast(sum(CUR_FY_YTD) as double) as Cur_YTD, cast(sum(PRV_MTD_TOTAL) as double) as Prv_Month, cast(sum(PRV_BUS_DAY) as double) as Prv_Day,cast(sum(PRV_DAY_AVG) as double) as Prv_Day_Avg, cast(sum(PRV_WEEK_AVG) as double) as Prv_Week_Avg, cast(sum(PRV_MONTH_AVG) as double) as Prv_Month_Avg,cast(sum(PRV_FY_YTD) as double) as Prv_YTD ,cast(sum(PRV_FY) as double) as Prv_FY, cast(sum(CUR_REV_ANN) as double) as Cur_Rev_Ann,cast(sum(NEXT_PLAN_PRIM) as double) as Next_Plan_Prim, cast(sum(NEXT_PLAN_SECDY) as double) as Next_Plan_Secdy,cast(sum(NEXT_PLAN) as double) as Next_Plan  from temp group by id,desk order by Cur_Ytd desc
[+][-]09/24/04 07:32 AM, ID: 12143585

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/04 07:55 AM, ID: 12143832

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/04 08:01 AM, ID: 12143898

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/04 08:03 AM, ID: 12143930

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/24/04 08:16 AM, ID: 12144058

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/04 08:18 AM, ID: 12144089

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/04 08:38 AM, ID: 12144356

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/04 08:45 AM, ID: 12144466

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/04 08:52 AM, ID: 12144560

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/04 10:47 AM, ID: 12145775

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/04 11:13 AM, ID: 12146018

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/04 11:53 AM, ID: 12146450

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/04 11:54 AM, ID: 12146458

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/04 12:08 PM, ID: 12146609

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/04 10:48 PM, ID: 12149368

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/28/04 05:32 AM, ID: 12168751

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/04 12:24 PM, ID: 12183446

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/29/04 05:20 PM, ID: 12185836

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Databases Miscellaneous
Tags: run, faster, make, query
Sign Up Now!
Solution Provided By: derekpapesch
Participating Experts: 4
Solution Grade: A
 
 
[+][-]09/29/04 08:10 PM, ID: 12186680

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74