These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: CreateQuery
PostPosted: Thu Aug 24, 2006 9:43 am 
Regular
Regular

Joined: Thu May 11, 2006 12:30 pm
Posts: 72
[b]Hibernate version:[/b] 1.2.0 Alpha1

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b] Microsoft Access

i'm experiencing low performance with this simple line of code on a table with 1.131.000 records


int count = (int) session.CreateQuery("select count(*) from mytable").UniqueResult();

i expected it runs in milliseconds: instead it take a lot of time to return; i think it read all the records and then
retrieve the count

is it possible ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 10:36 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I doubt that. Enable SQL logging and look at what SQL is generated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.