-->
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: N + 1 Select problem happening
PostPosted: Sat Feb 23, 2008 10:48 pm 
Beginner
Beginner

Joined: Thu Dec 13, 2007 2:32 pm
Posts: 26
if i have a table structure like this :

Code:
create table part(id number primary key, name varchar2(25));
create table product(id number primary key, name varchar2(25));
create table product_parts(id number, product_id number, part_id number, primary key(id, product_id, part_id), foreign key(part_id) references part(id), foreign key(product_id) references product(id);


My questions are :
1.)if i add a field to product_parts ( which is a join table ) does it affect the selection ? ( meaning can it cause n+1 select issues ? )
2.) How can create a criteria to load products from Product_Parts class without causing any n+1 selects.

Any kind of insight would be helpful.

_________________
Regards,
Vyas, Anirudh


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 24, 2008 5:55 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Sure it might happen. For ways to solve/prevent the problem see:
http://www.google.com/search?q=+N+%2B+1 ... +hibernate

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


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.