SQL Server - Very long query time with OpenJPA and Hibernate



Hello Everyone,

I am hoping somebody could point me in the right direction..

I have a table with close to a million entries. I've set up indexes
that are relevant to
the expected queries. Thanks to the indexes I can use Enterprise
Manager and
Query Analyzer to obtain results within say 3 seconds.

Those results are for when manually running queries generated by
OpenJPA and
also by Hibernate. However, when running the program itself, that uses
those frameworks,
the same query can take up to 30seconds before finally, and correctly,
returning even an
empty collection. That's on a production server, in instances when I
have even made sure
that the program is the only thing accessing the database server.

I don't observe such a long delay when executing the program on a
restored copy of the
database, and the table with ~million entries, on my own development
PC. The query time
is a matter of milliseconds.

I've copied all the data over to a PostgreSQL database, and here, on
both production server
and development workstation, the execution time is also a matter of
milliseconds.
I've used virtually identical META-INF\persistence.xml for the
respective frameworks on the
respective DBMS, and respective workstation/server.

I'm not clear where else to look for a culprit(s) here. I'm hoping
some people could help with
some advice. Thanks.

Rico.

.



Relevant Pages

  • Re: [PHP] Problem with SELECT statement and reference material wanted..
    ... echo you query and then run it on mysql and see u getting the desired ... I'm having trouble retrieving a selection of my database contents. ... ..I will get all entries from the database, ... required to be named as the column names in the MySQL table, ...
    (php.general)
  • Re: Access Table Sorting/Query Last Function
    ... I've put in a number of test entries to ensure it works, ... of the Lastin your totals query. ... I've been designing a database that basically works off two tables. ... I've done this so that I can pull the last entered ...
    (microsoft.public.access.tablesdbdesign)
  • Re: SQL Server - Very long query time with OpenJPA and Hibernate
    ... I have a table with close to a million entries. ... Query Analyzer to obtain results within say 3 seconds. ... That's on a production server, ... that the program is the only thing accessing the database server. ...
    (comp.lang.java.databases)
  • Form Design
    ... database with 2.2 million entries. ... Symbol for the company, the Date, and the Low Rate Price ... by way of a query but with this many entries in the database, ...
    (microsoft.public.access.forms)
  • Re: general question about how best to cache expensive query results
    ... feeds and sometimes don't include the field ... That was my first attempt to limit the entries ... would be the result of that original query. ... presenting the underlying problem and the business requirements. ...
    (comp.databases)