User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 423,304 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,339 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser: Programming Forums
Views: 456 | Replies: 2 | Solved
Reply
Join Date: Mar 2008
Posts: 18
Reputation: dele454 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dele454's Avatar
dele454 dele454 is offline Offline
Newbie Poster

Which is better in terms of optimization?

  #1  
Mar 27th, 2008
I just need your take on which of these two scenarios will yield quicker results with optimization in mind. On the front end there are a lot of pages with counts per category of events e.g Restaurants (40) | Pubs (2) | Gallery (6)

First Scenario:

events.gif

Having a stored procedure that would count each event per category based on this ER Diagram above or


Second Scenario:

Have the Event & Category tables as it is from above but have a series of Category tables for each individual Category. So Restaurant will have it own table, pub etc and house only the EventID for each event.

On counting instead of running a Stored procedure that scans through the whole event table + Category table like Scenario 1, I'll run one stored procedure that counts all these MyISAM Category table records to count how many records there are in each category table.


I need to know which will yield a faster outcome, which will be more memory intensive. These Categories will hardly change. There might be an additional category but that wont be an issue updating the Category table and creating a new eventcategory table.

Kindly let me have comments
Last edited by dele454 : Mar 27th, 2008 at 10:13 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: Ohio
Posts: 204
Reputation: plazmo is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: Which is better in terms of optimization?

  #2  
Mar 28th, 2008
Use the first scenario.
Keep all the events in one table and all the categories in one table.
It will be faster and easier to work with.
Reply With Quote  
Join Date: Mar 2008
Posts: 18
Reputation: dele454 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dele454's Avatar
dele454 dele454 is offline Offline
Newbie Poster

Re: Which is better in terms of optimization?

  #3  
Mar 28th, 2008
Thanks Plazmo. I appreciate the input.
I also need to ask: Data integrity is very paramount in my application. If a lot of my tables are of InnoDB type, would there be any performance lags as compared to using MyISAM
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Database Design Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Database Design Forum

All times are GMT -4. The time now is 11:04 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC