Subject | Faster insert |
---|---|
Author | Filipe Bortolini |
Post date | 2003-11-24T20:59:43Z |
Hi,
I need to insert 50.000 rows in a table in the same transaction (this insert operation must be atomic, 50.000 or nothing). But this operation is taking too long.
I use delphi + midas + ibx to access firebird and probably the midas dataset provider is creating 50.000 inserts instead of 1 insert with 50.000 rows.
My question is, what is the fastest way to insert these rows:
1. kick out midas and create a dml script in runtime;
1.1. create a insert statement for each row;
1.2. create only a insert statement with lots of lines;
2. let midas insert the rows, but add a commit(retaining) at each 500 rows and create some external code to control if all rows was inserted; (ugly)
3. Any other idea, or solutions that you already use.
[Non-text portions of this message have been removed]
I need to insert 50.000 rows in a table in the same transaction (this insert operation must be atomic, 50.000 or nothing). But this operation is taking too long.
I use delphi + midas + ibx to access firebird and probably the midas dataset provider is creating 50.000 inserts instead of 1 insert with 50.000 rows.
My question is, what is the fastest way to insert these rows:
1. kick out midas and create a dml script in runtime;
1.1. create a insert statement for each row;
1.2. create only a insert statement with lots of lines;
2. let midas insert the rows, but add a commit(retaining) at each 500 rows and create some external code to control if all rows was inserted; (ugly)
3. Any other idea, or solutions that you already use.
[Non-text portions of this message have been removed]