Solved

How can I use Oracle Hints to speed up Inserts?

Posted on 2014-12-27
2
242 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.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now