-->
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: Formula or Denormalize?
PostPosted: Thu Aug 11, 2005 4:08 am 
Hi,

I have a schema which, very simplified, is something like:

Forum ----<- Post

(There can be more than one forum)

The Forum class has a PostCount int on it so we don't have to get the entire collection of posts. We're currently using a formula to get the post count. Nice and simple.

However, we sometimes get a collection of Forums. Before using NHibernate, we had one big ugly query to work out the PostCount for each forum. We are now doing 1+N queries (where N is the collection size) to get the same data.

Is there a prefered way of doing this. Not worry about the performance hit, or denormalize the data (so when a post is added the postcount is incremented etc.)? Neither seem optimal.

Any ideas would be appreciated.

Nick H


Top
  
 
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.