openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Moti Nisenson (Created) (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2062) Poor performance for JPQL delete
Date Sat, 22 Oct 2011 13:26:32 GMT
Poor performance for JPQL delete

                 Key: OPENJPA-2062
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.0.1
         Environment: Derby 10.5.3
            Reporter: Moti Nisenson

If I have a simple entity as such

public class MyClass {
   Long id;
   @Column(name="xyz", nullable=false)
   Long field;

And I have a JPQL delete query: "delete from MyClass e where e.field=?1"
this gets translated into the following sql: DELETE from MyClass where id in (select distinct from MyClass t0 where ( = ?))

The extra select with distinct (rather than just having DELETE from MyClass where xyz=?) causes
a big performance slowdown; on the order of 5-10x (with Derby 10.5.3).

I didn't bother testing for different annotations, but I would imaging it's the same for all
of them.

Please fix this; it is very basic functionality and the SQL generated should be the straightforward,
high performing version.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message