Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: select + insert vs. insert and catching exception
Hi Christopher,
I'll go for option two. Avoids having to unnecessarily perform the select and access the index twice.
I would also recommend the use of a sequence (if appropriate) to eliminate the potential duplicate key error.
Cheers
Richard
"Christoph Seidel" <chris666.seidel_at_gmx.de> wrote in message
news:amut5g$9edrd$1_at_ID-143718.news.dfncis.de...
> what is better in respect of performance?
>
> select by primary key, if not found insert
>
> or
>
> insert and catch exception if primary key exists
>
> the table is quite small, less than 100 rows
>
>
Received on Thu Sep 26 2002 - 07:57:55 CDT