[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6978) JPA criteria query in is very slow when compared to hibernate criteria

Jan Stolze (JIRA) noreply at atlassian.com
Tue Jan 17 08:10:11 EST 2012


JPA criteria query in is very slow when compared to hibernate criteria
----------------------------------------------------------------------

                 Key: HHH-6978
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6978
             Project: Hibernate ORM
          Issue Type: Bug
          Components: query-criteria
    Affects Versions: 3.6.1
            Reporter: Jan Stolze
         Attachments: FlushAndTransactionTest.java

The criteria query using in clause is very slow when compared to Hibernate criteria queries.
See attached test code which is an extension of the test code which is delivered with the hibernate-entitymanager-3.4.0.GA package
FlushAndTransactionTest#testPoorSelect

Using a simple select on basis of name and id thus:
select * from book where id=1 and name in ('1','2','3',..)

when the in clause is large than it perform really bad when using JPA criteria queries.
On my local machine when in clause contains 1500 elements:
Using Hibernate criteria it took +/-0 ms when using JPA criteria it took +/-670 ms (!!!) a stunning amount of time.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list