On Sun, May 2, 2010 at 4:20 AM, Parag Kalra <paragka...@gmail.com> wrote:
> Hi All, > > I want to know which one of these algorithm would be the most optimized > solution to insert large number of records and Why: > > 1. Preparing an Insert query once and executing it with place holders for > the entire set of records > 2. Executing Oracle's sqlldr command and uploading the same set of records > I know others will correct me if I am wrong but doesn't SQLDR in the end do the same as #1. ie run a query with place holder?? I would think because of its speed SQLDR is using the array interface under the hood to do the inserts hence its speed. With SQLDR one have all the other little things taken care for you, file conversion, removing \n and tab ctr-x and so on. If you are keen just to see speed why not try some experiments with a language that implements the array interface 'Perl and DBD::Oracle' and see which one is faster. I know for a fact that doing it #1 style will be slower if you only insert per round trip to the DB. However if you use DBD::Oracle's array interface it may be faster as you can do many 1000s of inserts per round trip. Hope this helps > > Cheers, > Parag > -- Miss MySQL Conference 2010? No problem. Access Pythian speaker session videos at http://bit.ly/mysql2010