I have a table [ID,ITEM_NAME,ITEM_PRICE,ITEM_STATUS,ITEM_TYPE,ITEM_OWNER,ITEM_DATE]
The application can query the table with any number of search conditions like with item date and/or item owner etc.
In the resultset, I also need to fetch the counts by different status in ITEM_STATUS.
Its often causing timeouts when I try to get the counts based on status.
How is this case generally handled in large volume applications. Say Y mail. I have counts of how many are in inbox, how many are read/unred/sent and what not..almost instantly. How can such an experience be achieved?