Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Insert with large dataset

When running a query like "insert into table " how do we handle the commit size? I.e. are all records from anotherTable inserted in a single transaction OR is there a way to set a commit size?

Thanks very much ~Sri PS: I am a first timer here, and this site looks very good!


2 Answers

In good databases that is an atomic statement, so no, there is no way to limit the number of records inserted - which is a good thing!

like image 166
Otávio Décio Avatar answered Jul 19 '26 20:07

Otávio Décio


In the context that the original poster wants to avoid rollback space problems, the answer is pretty straightforward. The rollback segments should be sized to accpomodate the size of transactions, not the other way round. You commit when your transaction is complete.

like image 29
David Aldridge Avatar answered Jul 19 '26 20:07

David Aldridge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!