-->
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: best way to implement browsing with counts per selection?
PostPosted: Tue Oct 20, 2009 8:40 am 
Regular
Regular

Joined: Tue May 12, 2009 6:08 am
Posts: 92
Hi,

I'm exploring the best to do the following:

There is a view where the user can select various options, and each option builds a search query. The options are in different sections, like location, type, category, etc.

The screen will show all the options for each section. Next to each option, I need to put the number of results that are expected if they choose that option.

For example, One section might look like this:
Cities:
Los Angeles (40)
Detroit (1543)
Washington (667)

Now, if they select a category, the city result sizes need to change because the query will be filtered to those entities with both the category and the city:

Cities:
Los Angeles (2)
Detroit (150)
Washington (40)

This sort of thing can get widely complicated. In my mind, I have to run a "count" query for every single option on the screen and "pretend" that they selected it. However, isn't this going to be really slow if there are 80 different selections on the screen? I can't possibly run 80 queries...

What is the best way in hibernate to dig at this kind of information in a performant way? I already have the filtering query working - works great. I have everything else working just splendidly. Those count queries appear to be annoying.


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.