Solved

How can I use Oracle Hints to speed up Inserts?

Posted on 2014-12-27
2
245 Views
Last Modified: 2014-12-28
Dear Experts,

I have a PL/SQL procedure like below. I have implemented some session-wide Parameter Setting and Oracle Hints to speed up the operation. Do you think that I used the correct set of parameters and hints, or could you offer me better?

Notes:
1-TEMP_TABLE is a small table with approximately 100.000 rows compared to main table which has millions of rows.  2-TEMP_TABLE has no indexes while main table has a nonunique index with multiple fields including date field.
3-TEMP_TABLE is an ordinary table while the main table is partitioned daily.

BR  
----------------------------------------------------------------------------------------------------------------------------------------
DECLARE
.......
BEGIN
.......
EXECUTE IMMEDIATE 'ALTER SESSION SET db_file_multiblock_read_count=16';
INSERT /*+ APPEND PARALLEL NOLOGGING */ INTO MAIN_TABLE SELECT * FROM TEMP_TABLE;
COMMIT;
EXECUTE IMMEDIATE 'TRUNCATE TABLE TEMP_TABLE DROP STORAGE';
END;
0
Comment
Question by:GurcanK
2 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 40519656
if the temp table will have data for a particular day, you could insert directly to the partition that corresponds to that day.  it's not a hint, but could help.

your hints should help.   if you're going to force parallel, you might want to force a particular degree of parallelism otherwise it might vary from run to run.
0
 

Author Comment

by:GurcanK
ID: 40519669
How shall I insert derectly to the current day's partition? (partition creation is automatic in daily basis)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql query 9 45
Oracle 10g - insert string with special characters 8 56
Require data to appear on a single line 2 44
dbms_crypto.decrypt   errors out 6 31
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to take different types of Oracle backups using RMAN.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question