When we need to insert data(table) to database (NO RAC and RAC) faster...,
we should have disk i/o faster. that's a good idea (example: solid state or make raid 1+0)

INSERT INTO XXX VALUES(a,b,...);

Anyway What should we do on Oracle Database?

- insert nologging
- No Archivelog
- No index
- Use big block size(example 16k, 32k)
- Concern about redo log, if use logging

What about your idea to improve this case?

Tags: insert, table

Views: 3444

Reply to This

Replies to This Discussion

Hi ,

im using "insert /*+ APPEND */" hint option and its good as comapre to others.

Faheem.
if i insert with sub query, append hint, that is good.

It's not good with INSERT INTO XXX VALUES (.....,...)
Example:

begin
for x in 1 ..100
loop
insert into t01 values(x, 100);
commit;
end loop;
end;
/

Elapsed: 00:00:00.16



begin
for x in 1 ..100
loop
insert /*+ append */ into t01 values(x, 100);
commit;
end loop;
end;
/

Elapsed: 00:00:01.15
Hi Surachart,

Well there are many answers and my experiences have shown that it always depends on the use-cases.

What you can do to make inserts faster:

1) Bulking (if you want to make it fast, do bulking!) which reduces commits and commit time
2) Enough ITL on the block (INITRANS)
3) Depending on the size of a row: Blocksize, PCTFREE
4) No Indexing
5) No integrity checks (Foreign keys, not null constraints)
6) Buffer cache (if it's to small you'll early end up with I/O)

And the list goes on....

APPEND hint is also very useful on inserts because it's using DIRECT-PATH inserts which will append the data simply on the table. But be aware the unused space by the table will then not be filled up!

Also not forget paritioning!

Regards,

Gerald
Hi Surachart,

Gerald made an excellent exposition and I totally agree withg him.
From my personal experience I would recommend partitioning. But my experience is in the telecom world were we could easily make 20/30 million inserts per hour and some of these tables were partitioned by (day,hour) to improve insert speed, we had indexes and we could not use /*+append*/ because of backup restrictions.
If you need real insight or your specific case, may be you could post your full scenario.

Regards,
Filipe
I suggest before any guesses first you take an 10046 Level 8 SQL Trace and analyse it with tkprof to see where you spend the time with your inserts.

ps: If there are triggers they also might be a problem area.
Hi, do you have a column in the table to store the radius server id (i.ex server1, server2, ...)?
If so, is it indexed? Is it partitioned?
maybe you could consider partitioning the table according to the server. For instance
if table looks like this
c1, c2, radius_server_id, ...

You could use range or list partition by radious_server and the on each server, when you issue the insert statement you could specify the corresponding server id.

create table abc (c1 number,c2 number, radius_server varchar2(14)) partition by list (radius_server) (
PARTITION s1_server VALUES ('s1') ,
PARTITION s2_server VALUES ('s2') )
;

insert into abc partition (s2_server) values(1,2,'s2') ;
If the table is indexed by the server_id column, then using partitioning on that table and converting the index to local would produce even better results on insert.
Cheers,
Filipe
Thank You for your suggestion. that's a good idea.

Actually this table has kept about account, nas ip, etc... when users log on...
I have 4 indexes. I plan to recreate hash partition, But I think hash can not to improve.

Perhaps I might recreate with range(month) partition.

About list partition, I have no idea to choose about column... now.



Do you have any idea?
If your planning to rebuilt table and add partitions, i don't think hash would do the trick on this one...
I stand by adding a range or list partition using a column server_id and forcing each server to specify its own partition while doing the insert.

insert into abc partition (s2_server) values(1,2,'s2') ;
thank you.

And? sql statement, block size, init_trans, pct_free and freelists...

How do you think? Any Suggestion about them?


Surachart

RSS

Oracle Community On

I'm not a fan of advertising, and so I will not be including any advertisements on OracleCommunity.net. However, managing this community does not come without cost! If you are willing to donate to help pay for the monthly community fees and domain services I accept Bitcoin and PayPal donations.

Donate Bitcoins

Badge

Loading…

Blog Posts

Default Login Form customize

Dear All, I want to customize oracle 10g default login page. How can I do this. I attached the login page for better understanding.

Posted by Shakaouth Shanto on May 19, 2015 at 10:00pm

Live SAP Hybris Online Training Classes at VirtualNuggets

Web URL      :  http://www.virtualnuggets.com/sap-hybris.html

Email              :  info@virtualnuggets(dot)com

Contact           :  +1-7076668949(USA)         +91-8885560202(India) 

 

Live SAP Hybris Online Training Classes at VirtualNuggets

 

SAP Hybris is a standout amongst the most widely recognized e-commerce platforms       on the Internet…

Continue

Posted by Virtualnuggets on May 12, 2015 at 11:14pm

TIBCO BE Online Training

TIBCO BE Online Training

                                          

            We are Glad To Announce That TIBCO BE Online Training Offered by Industry real time Experts at VirtualNuggets Institute. we are offering TIBCO BE Online Training with a customized course design, The Learners who participate in our online training sessions will able to easily grab the required skills of TIBCO BE Which needed to solve integration challenges in real…

Continue

Posted by Virtualnuggets on May 6, 2015 at 11:27pm

IBM Sterling B2B Integrator Online Training Classes at VirtualNuggets

Web URL       :  http://www.virtualnuggets.com/ibm-sterling-integrator.html

Email               :  info@virtualnuggets com

Contact           :  +1-707 666 8949(USA)       +91-888 556 0202(India) 

 

Live IBM Sterling  B2B Integrator Online Training Classes at VirtualNuggets

 

            We are Glad To Announce That IBM Sterling B2B Integrator Online…

Continue

Posted by Virtualnuggets on May 6, 2015 at 12:41am

© 2015   Created by Steve Karam.

Badges  |  Report an Issue  |  Terms of Service