How to improve performance of insert statement

Hi all,
How to improve performance of insert statement
I am inserting 1lac records into table it takes around 20 min..
Plz help.
Thanx In Advance.

I tried :
SQL> create table test as select * from dba_objects;
Table created.
SQL> delete from test;
3635 rows deleted.
SQL> commit;
Commit complete.
SQL> select count(*) from dba_extents where segment_name='TEST';
COUNT(*)
4
SQL> insert /*+ APPEND */ into test select * from dba_objects;
3635 rows created.
SQL> commit;
Commit complete.
SQL> select count(*) from dba_extents where segment_name='TEST';
COUNT(*)
6
Cheers, Bhupinder

Similar Messages

  • How to improve Performance of the Statements.

    Hi,
    I am using Oracle 10g. My problem is when i am Execute & fetch the records from the database it is taking so much time. I have created Statistics also but no use. Now what i have to do to improve the Performance of the SELECT, INSERT, UPDATE, DELETE Statements.
    Is it make any differents because i am using WindowsXP, 1 GB RAM in Server Machine, and WindowsXP, 512 GB RAM in Client Machine.
    Pls. Give me advice for me to improve Performance.
    Thank u...!

    What and where to change parameters and values ?Well, maybe my previous post was not clear enough, but if you want to keep your job, you shouldn't change anything else on init parameter and you shouldn't fall in the Compulsive Tuning Disorder.
    Everyone who advise you to change some parameters to some value without any more info shouldn't be listen.
    Nicolas.

  • How to improve Performance for Select statement

    Hi Friends,
    Can  you please help me in improving the performance of the following query:
    SELECT SINGLE MAX( policyterm ) startterm INTO (lv_term, lv_cal_date) FROM zu1cd_policyterm WHERE gpart = gv_part GROUP BY startterm.
    Thanks and Regards,
    Johny

    long lists can not be produced with  a SELECT SINGLE, there is also nothing to group.
    But I guess the SINGLE is a bug
    SELECT MAX( policyterm ) startterm
                  INTO (lv_term, lv_cal_date)
                  FROM zu1cd_policyterm
                  WHERE gpart = gv_part
                  GROUP BY startterm.
    How many records are in zu1cd_policyterm ?
    Is there an index starting with gpart?
    If first answer is 'large' and second 'no'   =>   slow
    What is the meaning of gpart?  How many different values can it assume?
    If many different values then an index makes sense, if you are allowed to create
    an index.
    Otherwise you must be patient.
    Siegfried

  • Slow performance on Insert Statement

    Hi All,
    I realize my question is going to be very general....what I am looking for is someone to look at my insert statement below and pick out any inefficiencies or potential improvement points. I'm doing an insert into a very large table already but my insert statement is taking an extremely long time and I've had to cancel it a few times. Table A in the "From" clause has about 500 million records while Table B has about 350 million records. Table C is just a small reference table that I link to to pull a description column for a code. I have all the necessary indexes on the tables, specifically on the columns in the join clauses. I'm using an insert with append hint and the table is set to NOLOGGING. I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.5.0. If anyone has options on how to improve performance it would be much appreciated. Here's the Insert Statement below:
    insert /*+append */ into crg_edc_prevalence_raw
    select
    A.CRG_INPUT_REC_FISCAL_YR as fiscal_year,
    A.CRG_INPUT_REC_IDENTIFIER as phn,
    is_date(substr(a.crg_input_rec,13,8),'yyyymmdd') as date_of_encounter,
    decode(A.CRG_INPUT_REC_SRC,'CPIRUDBA.AHS_IP_DOCTOR_DX','Inpatient','Outpatient') as inpatient_outpatient_flag,
    ltrim(rtrim(substr(a.crg_input_rec,2,7))) as diag_cd,
    B.EDC_EPC as edc_CD,
    c.EDC_DESCRIPTION as edc_desc,
    C.EDC_AGG_CD,
    c.EDC_AGG_DESC as edc_agg_desc,
    a.crg_input_rec as m_record,
    ltrim(rtrim(substr(a.crg_input_rec,9,1))) as medical_cd_type,
    A.CRG_INPUT_REC_SEQ as sequence_number,
    A.CRG_METHOD_DIMR_1,
    A.CRG_METHOD_DIMR_2,
    A.CRG_METHOD_AHW_3
    from CRG_INPUT_FINAL_MASTER a,
         CRG_OUTPUT_R_RECORD_FINAL b,
        (SELECT EDC_CD,EDC_DESCRIPTION,EDC_AGG_CD,EDC_AGG_DESC FROM CRG_DIAG_EDC_REF GROUP BY EDC_CD,EDC_DESCRIPTION,EDC_AGG_CD,EDC_AGG_DESC) c
    where  A.CRG_INPUT_REC_SEQ = B.CRG_OUTPUT_R_REC_SEQ_MLINK
       and A.CRG_INPUT_REC_FISCAL_YR = B.FYE;
       and B.EDC_EPC = c.edc_cd(+)
       and A.CRG_INPUT_REC_SHORT_DESC = 'DIAGNOSIS'
       and b.fye = '201112';Thanks,
    Ed

    Try predicate pushing if that might substantially reduce the number of rows (maybe not both as shown here)
    insert /*+ append */
      into crg_edc_prevalence_raw
    select a.crg_input_rec_fiscal_yr as fiscal_year,
           a.crg_input_rec_identifier as phn,
           is_date(substr(a.crg_input_rec,13,8),'yyyymmdd') as date_of_encounter,
           a.inpatient_outpatient_flag,
           a.diag_cd,
           b.edc_epc as edc_cd,
           c.edc_description as edc_desc,
           c.edc_agg_cd,
           c.edc_agg_desc as edc_agg_desc,
           a.m_record,
           a.medical_cd_type,
           a.sequence_number,
           a.crg_method_dimr_1,
           a.crg_method_dimr_2,
           a.crg_method_ahw_3
      from (select crg_input_rec_seq,
                   crg_input_rec_fiscal_yr,
                   crg_input_rec_identifier,
                   substr(crg_input_rec,13,8) as maybe_date_of_encounter,
                   case crg_input_rec_src when 'CPIRUDBA.AHS_IP_DOCTOR_DX'
                                          then 'Inpatient'
                                          else 'Outpatient'
                   end as inpatient_outpatient_flag,
                   trim(substr(crg_input_rec,2,7)) as diag_cd,
                   crg_input_rec as m_record,
                   trim(substr(crg_input_rec,9,1)) as medical_cd_type,
                   crg_input_rec_seq as sequence_number,
                   crg_method_dimr_1,
                   crg_method_dimr_2,
                   crg_method_ahw_3
              from crg_input_final_master
             where crg_input_rec_short_desc = 'DIAGNOSIS'
           ) a,
           (select crg_output_r_rec_seq_mlink,
                   fye,
                   edc_epc,
              from crg_output_r_record_final
             where fye = '201112'
           ) b,
           (select edc_cd,
                   edc_description,
                   edc_agg_cd,
                   edc_agg_desc
              from crg_diag_edc_ref
             group by edc_cd,edc_description,edc_agg_cd,edc_agg_desc
           ) c
    where a.crg_input_rec_seq = b.crg_output_r_rec_seq_mlink
       and a.crg_input_rec_fiscal_yr = b.fye;
       and b.edc_epc = c.edc_cd(+)Regards
    Etbin
    Edited by: Etbin on 5.6.2013 19:15
    Oops! Should have checked before posting.

  • How to improve performance of the attached query

    Hi,
    How to improve performance of the below query, Please help. also attached explain plan -
    SELECT Camp.Id,
    rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount,
    (SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
    rCam.AccountKey as AccountKey
    FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
    WHERE Camp.AccountKey = rCam.AccountKey
    AND Camp.AvCampaignKey = rCam.AvCampaignKey
    AND Camp.AccountKey = CamBilling.AccountKey
    AND Camp.CampaignKey = CamBilling.CampaignKey
    AND rCam.AccountKey = xSite.AccountKey
    AND rCam.AvSiteKey = xSite.AvSiteKey
    AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
    to_date('01-01-2011', 'DD-MM-YYYY')
    GROUP By rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount
    Explain Plan :-
    Description Object_owner Object_name Cost Cardinality Bytes
    SELECT STATEMENT, GOAL = ALL_ROWS 14 1 13
    SORT AGGREGATE 1 13
    VIEW GEMINI_REPORTING 14 1 13
    HASH GROUP BY 14 1 103
    NESTED LOOPS 13 1 103
    HASH JOIN 12 1 85
    TABLE ACCESS BY INDEX ROWID GEMINI_REPORTING RCAMSIT 2 4 100
    NESTED LOOPS 9 5 325
    HASH JOIN 7 1 40
    SORT UNIQUE 2 1 18
    TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY SITE 2 1 18
    INDEX RANGE SCAN GEMINI_PRIMARY SITE_I0 1 1
    TABLE ACCESS FULL GEMINI_PRIMARY SITE 3 27 594
    INDEX RANGE SCAN GEMINI_REPORTING RCAMSIT_I 1 1 5
    TABLE ACCESS FULL GEMINI_PRIMARY CAMPAIGN 3 127 2540
    TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY CAMBILLING 1 1 18
    INDEX UNIQUE SCAN GEMINI_PRIMARY CAMBILLING_U1 0 1

    duplicate thread..
    How to improve performance of attached query

  • How to improve performance of attached query

    Hi,
    How to improve performance of the below query, Please help. also attached explain plan -
    SELECT Camp.Id,
    rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount,
    (SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
    rCam.AccountKey as AccountKey
    FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
    WHERE Camp.AccountKey = rCam.AccountKey
    AND Camp.AvCampaignKey = rCam.AvCampaignKey
    AND Camp.AccountKey = CamBilling.AccountKey
    AND Camp.CampaignKey = CamBilling.CampaignKey
    AND rCam.AccountKey = xSite.AccountKey
    AND rCam.AvSiteKey = xSite.AvSiteKey
    AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
    to_date('01-01-2011', 'DD-MM-YYYY')
    GROUP By rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount
    Explain Plan :-
    Description Object_owner Object_name Cost Cardinality Bytes
    SELECT STATEMENT, GOAL = ALL_ROWS 14 1 13
    SORT AGGREGATE 1 13
    VIEW GEMINI_REPORTING 14 1 13
    HASH GROUP BY 14 1 103
    NESTED LOOPS 13 1 103
    HASH JOIN 12 1 85
    TABLE ACCESS BY INDEX ROWID GEMINI_REPORTING RCAMSIT 2 4 100
    NESTED LOOPS 9 5 325
    HASH JOIN 7 1 40
    SORT UNIQUE 2 1 18
    TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY SITE 2 1 18
    INDEX RANGE SCAN GEMINI_PRIMARY SITE_I0 1 1
    TABLE ACCESS FULL GEMINI_PRIMARY SITE 3 27 594
    INDEX RANGE SCAN GEMINI_REPORTING RCAMSIT_I 1 1 5
    TABLE ACCESS FULL GEMINI_PRIMARY CAMPAIGN 3 127 2540
    TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY CAMBILLING 1 1 18
    INDEX UNIQUE SCAN GEMINI_PRIMARY CAMBILLING_U1 0 1

    duplicate thread..
    How to improve performance of attached query

  • How to improve performance of MediaPlayer?

    I tried to use the MediaPlayer with a On2 VP6 flv movie.
    Showing a video with a resolution of 1024x768 works.
    Showing a video with a resolution of 1280x720 and a average bitrate of 1700 kb/s leads to a delay of the video signal behind the audio signal of a couple of seconds. VLC, Media Player Classic and a couple of other players have no problem with the video. Only the FX MediaPlayer shows a poor performance.
    Additionally mouse events in a second stage (the first stage is used for the video) are not processed in 2 of 3 cases. If the MediaPlayer is switched off, the mouse events work reliable.
    Does somebody know a solution for this problems?
    Cheers
    masim

    duplicate thread..
    How to improve performance of attached query

  • How to improve performance of query

    Hi all,
    How to improve performance of query.
    please send :
    [email protected]
    thanks in advance
    bhaskar

    hi
    go through the following links for performance
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    http://www.asug.com/client_files/Calendar/Upload/ASUG%205-mar-2004%20BW%20Performance%20PDF.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2

  • How to improve performance of Siebel Configurator

    Hi All,
    We are using Siebel Configurator to model the item structures. We wrote few constraint rules on that. But while launching the configurator it is taking more time to open.
    Even without rules also it is behaving in the same manner.
    Any inputs on this could be highly appreciated
    RAM

    duplicate thread..
    How to improve performance of attached query

  • HT1430 I do a hard reset of my iPhone every so often because I feel it improves performance, but Apple states 'Reset ONLY if the device is not responding'. Forget about my OCD on this, but is their any reason my Apple stresses the ONLY DO THIS if not resp

    I do a hard reset of my iPhone every so often because I feel it improves performance, but Apple states 'Reset ONLY if the device is not responding'. Forget about my OCD on this, but is their any reason my Apple stresses the ONLY DO THIS if not responding?

    deggie wrote:
    Because it is more far-reaching than just turning the phone off and back on, it completely takes out anything in volatile memory, etc. I do reset mine if I notice problems such as no email coming in, text message issues, etc. but the same thing could probably be accomplished by just turning the phone off and on in your case.
    Thanks deggie, I think I get it now. Volatile memory (I had to look it up!) is memory that is lost on loss of power, so it's as you say... I'm not achieving anything on a normally functioning iPhone as on-off achieves the same result!... Thanks

  • How to improve performance for Custom Extractor in BI..

    HI all,
               I am new to BI and started working on BI for couple of weeks.. I created a Custom Extractor(Data View) in the Source system and when i pull data takes lot of time.. Can any one respond to this, suggesting how to improve the performance of my custom Extractor.. Please do the needfull..
      Thanks and Regards,
    Venugopal..

    Dear Venugopal,
    use transaction ST05 to check if your SQL statements are optimal and that you do not have redundant database calls. You should use as much as possible "bulking", which means to fetch the required data with one request to database and not with multiple requests to database.
    Use transaction SE30 to check if you are wasting time in loops and if yes, optimize the algorithm.
    Best Regards,
    Sylvia

  • How to Improve performance issue when we are using BRM LDB

    HI All,
    I am facing a performanc eissue when i am retriving the data from BKPF and respective BSEG table....I see that for fiscal period there are around 60lakhs records. and to populate the data value from the table to final internal table its taking so much of time.
    when i tried to make use of the BRM LDB with the SAP Query/Quickviewer, its the same issue.
    Please suggest me how to improve the performance issue.
    Thanks in advance
    Chakradhar

    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting - post locked
    Rob

  • HOW TO IMPROVE PERFORMANCE ON SUM FUNCTION IN INLINE SQL QUERY

    SELECT NVL(SUM(B1.T_AMOUNT),0) PAYMENT,B1.ACCOUNT_NUM,B1.BILL_SEQ
    FROM
    SELECT P.T_AMOUNT,P.ACCOUNT_NUM,P.BILL_SEQ
    FROM PAYMENT_DATA_VIEW P
    WHERE TRUNC(P.ACC_PAYMENT_DATE) < '01-JAN-2013'
    AND P.CUSTOMER_NAME ='XYZ'
    AND P.CLASS_ID IN (-1,1,2,94)
    ) B1
    GROUP BY B1.ACCOUNT_NUM,B1.BILL_SEQ
    Above is the query.If we run inner query it takes few second to execute but while we are summing up the same amount and bill_Seq using inline view, it takes time to execute it.
    Note: Count of rows selected from inner query will be around >10 Lac
    How to improve the performance for this query?
    Pls suggest
    Thanks in advance

    989209 wrote:
    SELECT NVL(SUM(B1.T_AMOUNT),0) PAYMENT,B1.ACCOUNT_NUM,B1.BILL_SEQ
    FROM
    SELECT P.T_AMOUNT,P.ACCOUNT_NUM,P.BILL_SEQ
    FROM PAYMENT_DATA_VIEW P
    WHERE TRUNC(P.ACC_PAYMENT_DATE) < '01-JAN-2013'
    AND P.CUSTOMER_NAME ='XYZ'
    AND P.CLASS_ID IN (-1,1,2,94)
    ) B1
    GROUP BY B1.ACCOUNT_NUM,B1.BILL_SEQ
    Above is the query.If we run inner query it takes few second to execute but while we are summing up the same amount and bill_Seq using inline view, it takes time to execute it.
    Note: Count of rows selected from inner query will be around >10 Lac
    How to improve the performance for this query?
    Pls suggest
    Thanks in advancea) Lac is not an international unit, so is not understood by everyone. This is an international forum so please use international units.
    b) Please read the FAQ: {message:id=9360002} to learn how to format your question correctly for people to help you.
    c) As your question relates to performance tuning, please also read the two threads linked to in the FAQ: {message:id=9360003} for an idea of what specific information you need to provide for people to help you tune your query.

  • How to improve performance of my query

    Hello Friends,
    Good Morning.
    I am having the following query which is never ending - Can any one throw some light on how to improve the performance of my said said query ..This is the query generated in ODI ( ORACLE DATA INTEGRATOR 11G )
    The only thing I can put in this query is optimizers
    - issue resolved
    Please advice .
    Thanks / Kumar
    Edited by: kumar73 on May 18, 2012 6:38 AM
    Edited by: kumar73 on May 18, 2012 6:39 AM
    Edited by: kumar73 on May 18, 2012 12:04 PM

    The two DISTINCTs are redundant, as UNION results in unique records, as a set can't have duplicates.
    Other than that the query is not formatted and unreadable, and you didn't provide a description of the tables involved.
    Your strategy seems to be maximum help from this forum with minimum effort from yourself, other than hitting copy and paste.
    Sybrand Bakker
    Senior Oracle DBA

  • How to retrieve value from insert statement

    hi,
    how can i get a certain value from insert statement and store it in a variable.
    suppose i am inserting emp_no , emp_name , emp_salary to employee table
    and i want to store the emp_name in a variable for other processing,
    how can i accomplish this ? i'm guessing that i have to use trigger,
    but dont know the procedure .
    any help will be greatly appreciated
    thanks

    insert into <table> valiues (....) returning <expression> into <variable>
    You could and should have found this using the SQL Language reference manual
    or
    http://www.morganslibrary.org/reference/insert.html
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • IPhoto version 4 wont open pictures burned on CD using version 5?

    i have a G5 iSight PowerPC and my girlfriend a G4 ibook (2004). I downloaded our vacation pics from my camera to my G5 using iPhoto v5.0.4 and accidentally erased my camera's memory card after the download. So - I thought I'd burn a disc with the new

  • Excel file attach problem

    Looking for advice! I created an POI HSSFWorkbook object. When I'm writing in a file the structure shows as correct. When I create a file and then subsequently attach to mail the file comes arrives as right. If I do a direct attachment of the HSSFWor

  • Project Currency - How to change

    Hi all, In the project profile , we have maintained a project currency, which gets defaulted in the project, once the project is created. All WBS elements created also get the same project currecy and the field gets greyed. I am unable to change the

  • Problems during import BW structure - Don't view the queries

    Hello! I have a problem when import the structure of BW 7.0 with xmla file in OBIEE+. The version of OBIEE is 10.1.3.4. When I do the importation, I don't see the queries created on BW, only the infocubes. But the queries is associate to infocube. Ca

  • Faces show many unnamed and asking for ID with no pics?

    I show many unnamed faces and many are named without showing the picture. When I select it, it show many pics in the folder but no pic on the folder - just a question asking if this ??? I went in to the pic folder and selected a pic asking that it us