You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ol...@ppi.de on 2003/08/21 16:15:43 UTC

performance: surpress m:n collection deletion on insert

Hello,

I have found and fixed a performance issue.

Suppose you have a pc class A with a collection field
with itemClass B, and supose that collection is mapped to an
indirection table A_B.

If you insert a fresh A instance with a null collection,
then this results in one INSERT statement for the A 
table and one DELETE statement for the indirection table A_B.

The latter should usually be superflous, since there should
not be any entries in the indirection table.  If there are
ones, this is probably an error.

In my proposed fix, I surpress the deleteMtoNImplementor() call
inside storeCollections().  

If you consider this change of behaviour risky, then I would
like to propose to add a configuartion parameter that allows
to force the old behaviour.

In my model, the proposed fix results in a significant 
performance improvement because the class A has severall
collection fields which are mostly null.

If you have another idea how to surpess the superflous calls,
I would like to know.

What do you think?

Olli
-- 
  Dr. Oliver Matz
  ppi Media GmbH
  Deliusstraße 10
  D-24114 Kiel
  phone		+49 (0) 43 1-53 53-422
  fax     	+49 (0) 43 1-53 53-2 22
  email	mailto:oliver.matz@ppi.de
  web	www.ppi.de




Re: performance: surpress m:n collection deletion on insert

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi oli,

your patch got lost.

jakob

oliver.matz@ppi.de wrote:

>Hello,
>
>I have found and fixed a performance issue.
>
>Suppose you have a pc class A with a collection field
>with itemClass B, and supose that collection is mapped to an
>indirection table A_B.
>
>If you insert a fresh A instance with a null collection,
>then this results in one INSERT statement for the A 
>table and one DELETE statement for the indirection table A_B.
>
>The latter should usually be superflous, since there should
>not be any entries in the indirection table.  If there are
>ones, this is probably an error.
>
>In my proposed fix, I surpress the deleteMtoNImplementor() call
>inside storeCollections().  
>
>If you consider this change of behaviour risky, then I would
>like to propose to add a configuartion parameter that allows
>to force the old behaviour.
>
>In my model, the proposed fix results in a significant 
>performance improvement because the class A has severall
>collection fields which are mostly null.
>
>If you have another idea how to surpess the superflous calls,
>I would like to know.
>
>What do you think?
>
>Olli
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org