Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Performance problem hard to solve

Re: Performance problem hard to solve

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Mon, 04 Jun 2007 20:22:11 +0200
Message-ID: <f41q7e$v21$1@news4.zwoll1.ov.home.nl>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hole wrote:

> In details, we have an XML file containing a set of records. I've
> taken a look to MERGE INTO statement and it seems that assumes a
> "source table" and it's not true in our case.
> Also, we have a class performing an InsertOrUpdate fashion and another
> for UpdateOrInsert fashion.
>
> Sincerely, I don't still know why It needs thid differentiation.

Because it takes time to come to the conclusion you are in an error state:

Oh - here's something new, let's insert. Darn, got an error!
Hm - seems we already got that record.
Okay, let's update then.

Is slower than:

Oh - here's something, let's update.

Same scenario when you try to update, and cannot:

Oh - here's something, let's update.
Darn, got an error!
Hm - seems we don't have that record.
Okay, let's insert then.

Is slower than:

Oh - here's something new, let's insert!.

It depends on your data: expect a lot of updates, less inserts? Go for UpdateOrInsert.
Expect a lot of new data, with less updates than new? Go for the InsertOrUpdate.

Top-posting is one way to shut me up...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFGZFhTLw8L4IAs830RAkx4AJsEPb23ynNBsJSYVSfcRvrUZrslrACffYX/ W5F4muAtvDfJMpCL8X9AgO0=
=uW8+
-----END PGP SIGNATURE----- Received on Mon Jun 04 2007 - 13:22:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US