-->
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.  [ 3 posts ] 
Author Message
 Post subject: fetch_size
PostPosted: Thu Jan 29, 2004 7:28 pm 
Beginner
Beginner

Joined: Fri Oct 10, 2003 10:30 am
Posts: 35
Location: Stockholm
Is the following behaviour normal running this kind of query?

[pseudo language]
Code:
select store.products where store.id=?


The sql produced looks like this [pseudo language again]:
Code:
select id from product joined with a store where store.id=?
select * from product where id=?
select * from product where id=?
....


In other words, the query first retrieves the ids of and then performs a select for each of the found ids.
I guess it would be faster to achieve it with a product.* in the first query.

I played around with fetch_size and batch_size but with no success.

What's the deal?
Thanx
Robcos


Code:
#Hibernate properties
#Thu Jan 22 10:01:51 CET 2004
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.jdbc.use_streams_for_binary=true
hibernate.show_sql=true
hibernate.use_outer_join=true
hibernate.jdbc.batch_size=30
hibernate.jdbc.fetch_size=30
hibernate.cache.use_query_cache=true


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 8:17 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
read the iterate() vs find() discussion on:
- the reference guide
- the javadoc
- the forum

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 5:06 am 
Beginner
Beginner

Joined: Fri Oct 10, 2003 10:30 am
Posts: 35
Location: Stockholm
Thanx.
I was using Query.scroll() to return a page of result instead of Query.list() with Query.setMaxResults();
/robcos


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.