Subject RE: [IBO] Firebird performance / IBO
Author Jason Wharton
> Not sure if this question should be here or the Firebird list but
> thought the component might have some impact.
>
> If I have to do millions of inserts into a table is it quicker to do
>
> a) Check to see if record exists, if not add it

No, this is very inefficient.

> or
> b) Insert regardless and trap the exception triggered by a pk
> violation

You can do this in a stored procedure.

Better yet, if you can, configure the data to be inserted as an external
text file and do it all on the server using the stored procedure.

You can have it do the insert in a BEGIN END block and catch and handle the
exception as you please. Typically, I handle it as an update of some kind,
but your situation may vary.

Jason Wharton