Subject RE: [ib-support] Importing Records
Author Mike Grover
I used INSERT INTO ... VALUES (...)
From a Delphi6 program I wrote

How Can I insert a certain number of records from a external file?


-----Original Message-----
From: Ivan Prenosil [mailto:prenosil@...]
Sent: Thursday, August 16, 2001 9:28 AM
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] Importing Records


> Does anybody know of a way import a very large number of records into
> IB6
>
> I am adding records by the SQL command INSERT
>
> and doing a transaction about every 1000000 million records.
>
> I'm only getting about 8 million records / hour, and i have 110 million
> records to import.


Which kind of INSERT do you use ?
INSERT INTO ... VALUES (...)
or
INSERT INTO ... SELECT ... FROM <external table>


My guess is that you use external table, and so you are inserting a million
rows by one command.
Each command in IB is "atomic" (it either inserts all 1000000 records,
or it does not insert anything; if e.g. row 999999 fails due to check
constraint, 999998 previously inserted rows must be removed).
To support this functionality, IB needs to hold (in memory!)
list of all changes made by current command.

So, to speed things up you do not have to commit after every X inserts,
but rather reduce amount of updates made by single command
(and thus reduce memory demands).

(You can also use select stored procedure with FOR SELECT loop,
and execute SUSPEND after some amount of INSERTs, because work done
by SP can be undone only to last SUSPEND command).


Ivan
prenosil@...
http://www.volny.cz/iprenosil/interbase


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Do you need to encrypt all your online transactions? Secure corporate intranets? Authenticate your Web sites? Whatever
security your site needs, you'll find the perfect solution here!
http://us.click.yahoo.com/Bre3tC/Q56CAA/yigFAA/dpFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/