You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by William Cai <wc...@xwarelabs.com> on 2007/03/16 02:36:42 UTC

Performance declined dramatically during a series of delete operation

Hi list,
I've ran KODO/OpenJPA on Oracle for a while. It works well. But now I meet a
problem when executing a large series of delete operation with it -- the
performance is declined dramatically.
The scenario is like below,
1. About 40 tables, and there are some external references among those
tables.
2. The operation queries if the target data exist, if yes, then delete it.
3. We will delete about 100,000 lines from the tables

Currently behavior:
First 1500 lines are deleted in about 1 second, but the later, the slower.
At last it takes 7 minutes to delete 200 lines.

Did anybody meet such a problem before? Please share your experience.

Thanks a lot!

William

Re: Performance declined dramatically during a series of delete operation

Posted by Abe White <aw...@bea.com>.
> EM.flush() doesn't help. :-(
>
> On 3/16/07, Patrick Linskey <pl...@bea.com> wrote:
>>
>> Have you tried incrementally calling EM.flush() during the course of
>> your transaction? Also, for deleting that many records, you may  
>> want to
>> look at using JPQL's bulk delete APIs.

Do you have the data cache enabled?  Have you tried to enable large  
transaction mode along with the incremental flushing?  http:// 
incubator.apache.org/openjpa/docs/latest/javadoc/index.html
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Re: Performance declined dramatically during a series of delete operation

Posted by William Cai <wc...@xwarelabs.com>.
EM.flush() doesn't help. :-(

On 3/16/07, Patrick Linskey <pl...@bea.com> wrote:
>
> Have you tried incrementally calling EM.flush() during the course of
> your transaction? Also, for deleting that many records, you may want to
> look at using JPQL's bulk delete APIs.
>
> -Patrick
>
> --
> Patrick Linskey
> BEA Systems, Inc.
>
> _______________________________________________________________________
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
>
> > -----Original Message-----
> > From: William Cai [mailto:wcai@xwarelabs.com]
> > Sent: Thursday, March 15, 2007 6:37 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: Performance declined dramatically during a series of
> > delete operation
> >
> > Hi list,
> > I've ran KODO/OpenJPA on Oracle for a while. It works well.
> > But now I meet a
> > problem when executing a large series of delete operation
> > with it -- the
> > performance is declined dramatically.
> > The scenario is like below,
> > 1. About 40 tables, and there are some external references among those
> > tables.
> > 2. The operation queries if the target data exist, if yes,
> > then delete it.
> > 3. We will delete about 100,000 lines from the tables
> >
> > Currently behavior:
> > First 1500 lines are deleted in about 1 second, but the
> > later, the slower.
> > At last it takes 7 minutes to delete 200 lines.
> >
> > Did anybody meet such a problem before? Please share your experience.
> >
> > Thanks a lot!
> >
> > William
> >
>

RE: Performance declined dramatically during a series of delete operation

Posted by Patrick Linskey <pl...@bea.com>.
Have you tried incrementally calling EM.flush() during the course of
your transaction? Also, for deleting that many records, you may want to
look at using JPQL's bulk delete APIs.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: William Cai [mailto:wcai@xwarelabs.com] 
> Sent: Thursday, March 15, 2007 6:37 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Performance declined dramatically during a series of 
> delete operation
> 
> Hi list,
> I've ran KODO/OpenJPA on Oracle for a while. It works well. 
> But now I meet a
> problem when executing a large series of delete operation 
> with it -- the
> performance is declined dramatically.
> The scenario is like below,
> 1. About 40 tables, and there are some external references among those
> tables.
> 2. The operation queries if the target data exist, if yes, 
> then delete it.
> 3. We will delete about 100,000 lines from the tables
> 
> Currently behavior:
> First 1500 lines are deleted in about 1 second, but the 
> later, the slower.
> At last it takes 7 minutes to delete 200 lines.
> 
> Did anybody meet such a problem before? Please share your experience.
> 
> Thanks a lot!
> 
> William
>