Forum Moderators: open
Here is the question:
Knowing that a few thousands rows will be added and keep growing....
and that also search will be performed as well as ranking calculations
From a speed and organization stand point of view which model should I go with?
A or B?
thanks
Since 10 categories will exits 10 such tables will be required
Why?
Can you explain what you mean by categories?
If you are talking about the records in the main table having membership in multiple categories, then your choices are:
1. 10 boolean attributes in the main table indicating membership or non-membership in the category
2. two additional tables (not 10). One with codes and descriptions of categories, and one relating widgets to categories.
I would never do (1). It's too inflexible. What if you want to add an 11'th category?
I'm not sure what you were intending to do with 10 tables.
Oh... you want to have 1 table for each category, listing the widget IDs of the widgets in that category?
If so, I think you are better off with two additional tables, then you can handle any number of categories.
widget
id
name
frumpleness
descriptioncategory
id
descriptionwidget-category
widget id
category id
there are 10 different categories with exactly the same DB criteria.
search will be by Category, by State, by County
Then have a category column like
[category]
id
category
The field category_id would hold the numeric key to the category table.
You probably also want to do this with some of your other columns, i.e. have a user table with the username, password, address and user_level and then refer to that with an user_id field so:
[user]
id
username
password
address
user_level
so your initial table would simplify to
id, category_id, user_id, item_description, item_comments, item_ranking, timestamp, activated
Unless you want items to be able to be in different locations from the posters, then I'd say make an address table...