SQL Performance (MOSC)

MOSC Banner

sql profile

edited Dec 11, 2013 11:59PM in SQL Performance (MOSC) 5 commentsAnswered
Hi,

we have CTAS statements for which it takes more than 6 to 7 hours to complete,i have picked only the select sql and created a profile for that statement and executes within 8 mins,

Is there any way we can make use of the sql profile created for this statement in the CTAS statement it is not automatically picking up the profile created.


CREATE TABLE Q$_Q_FC_AGG_AVG_TMP NOLOGGING AS SELECT /*+ USE_MERGE(TMP,AGG) */ /*+ NO_CPU_COSTING */ agg.business_unit ,agg.project_id ,agg.activity_id ,agg.resource_type ,agg.resource_category ,agg.resource_sub_cat ,agg.country ,agg.foreign_currency ,agg.q_proj_currency ,SUM(agg.FOREIGN_AMOUNT) AS Q_SRC_AVG_BILLED ,SUM(agg.Q_CONS_AMOUNT) AS Q_CON_AVG_BILLED FROM PS_Q_proj_res_agg agg , PS_Q_FC_AGG_TMP24 tmp WHERE tmp.business_unit=agg.business_unit AND tmp.project_id=agg.project_id AND tmp.activity_id=agg.activity_id AND tmp.resource_type=agg.resource_type AND tmp.resource_category=agg.resource_category AND tmp.resource_sub_cat=agg.resource_sub_cat AND tmp.country=agg.country AND tmp.foreign_currency=agg.foreign_currency AND tmp.q_proj_currency=agg.q_proj_currency AND agg.contract_type IN ('FULLSERVICE','UNIT','FIXFEE','CUSTOMERMANAGED') AND agg.analysis_type IN ('INV','BAJ','DSC','FBD') AND agg.q_tran_type='PC' AND agg.activity_type IN ('TIME','FFS','TMCUR') AND to_date(agg.Q_year || '-' || agg.Period || '-01','YYYY-mm-dd') BETWEEN to_date(2013 || '-' || 6 || '-01','YYYY-MM-DD') AND to_date(2013 || '-' || 11 || '-01','YYYY-MM-DD') GROUP BY agg.business_unit,agg.project_id,agg.activity_id,agg.resource_type,agg.resource_category,agg.resource_sub_cat, agg.country,agg.foreign_currency,agg.q_proj_currency

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center