-->
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.  [ 1 post ] 
Author Message
 Post subject: Decreasing performance with iteration
PostPosted: Mon Aug 15, 2011 1:41 pm 
Newbie

Joined: Mon Aug 16, 2010 12:32 pm
Posts: 12
Hi,

When I iterate over my join table I get decreasing performance till the whole thing just stopps

I have 1 main table with 4.5 million records
2nd join table with 30 Million records
3rd 'category' table with 12 thousand records

So the mapping table joins the main table with the 'category' table

With 5 threads the whol thing starts at about 30M/b sec than lineray decreases till at about 60% it grinds to a halt

Code:
public class Company {
..

    @OneToMany(fetch = FetchType.EAGER, mappedBy = "company", cascade = CascadeType.ALL, orphanRemoval = true)
    @OrderBy
    private Collection<CompanyCategoryMapping> compCat;
..
}

public class CompanyCategoryMapping {
..

   
   @ManyToOne(fetch = FetchType.EAGER)
   @JoinColumn(name = "category_id", nullable = false)
   private Category category;
..
}


So when I do full iterate over company and try to map categories to it I get this problem

Code:
        Criteria criteria = session.createCriteria(Company.class);
        criteria.setFetchMode("compCat", FetchMode.SELECT);
        criteria.add(Restrictions.in("id", ids));
        criteria.setReadOnly(true);
        criteria.setLockMode(LockMode.OPTIMISTIC);
        criteria.setFlushMode(FlushMode.AUTO);
        CategoryContainer container = null;
        ScrollableResults rs = criteria.scroll(ScrollMode.FORWARD_ONLY);


I tried tinkering with all settings and nothing helps or makes a difference, the problem is only the performance degradation and than the total shutdown at about 60%
I dont get any memory problems etc. I run this on a developer machine with 8 cores and 32Gb ram so it's not the hardware for sure

What can be the cause and solution to this ? I can immagine that this sort of operation is very standard


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

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.