MarioPro
11-25-2005, 08:56 PM
Hi,
I was wondering, and thanks in advance for your comments, what is the best way to make the database tables in order to speed up and drive it effectively on user searches on the following example.
I have a kind of hierarchy for keywords, i.e.:
Animals
Animals > Livestock
Animals > Livestock > Cow
Animals > Livestock > Cow > Beef cow
Animals > Livestock > Cow > Beef cow > Black Angus
Animals > Livestock > Cow > Beef cow > Charolais
Animals > Livestock > Cow > Dairy cow
Animals > Livestock > Cow > Dairy cow > Guernsey
Animals > Livestock > Cow > Dairy cow > Jersey
Animals > Pet
Animals > Pet > Reptile
Animals > Pet > Reptile > Snake
Animals > Pet > Reptile > Turtle
Boats
Boats > Fishing
Boats > Fishing > Sail
Boats > Fishing > Motor
Boats > Leisure
(...) etc.
Now, should I group all in just one table or build a seprate table for each branch or sub-categories? Like:
1 | 0 | 0 | 0 | Animals
1 | 1 | 0 | 0 | Livestock
1 | 1 | 1 | 0 | Cow
1 | 1 | 1 | 1 | Beef cow
1 | 1 | 1 | 2 | Dairy cow
1 | 2 | 0 | 0 | Pet
1 | 2 | 1 | 0 | Reptile
2 | 0 | 0 | 0 | Boats
2 | 1 | 0 | 0 |Fishing
etc.
or just
Main cat table
1 | Animals
2 | Boats
Second cat table
1 | 1 | Livestock
2 | 1 | Pet
3 | 2 | Fishing
Third cat table
1 | 1 | 1 | Cow
2 | 1 | 1 | Goat
3 | 1 | 2 | Snake
4 | 2 | 1 | Sailing
Thanks for any help
I was wondering, and thanks in advance for your comments, what is the best way to make the database tables in order to speed up and drive it effectively on user searches on the following example.
I have a kind of hierarchy for keywords, i.e.:
Animals
Animals > Livestock
Animals > Livestock > Cow
Animals > Livestock > Cow > Beef cow
Animals > Livestock > Cow > Beef cow > Black Angus
Animals > Livestock > Cow > Beef cow > Charolais
Animals > Livestock > Cow > Dairy cow
Animals > Livestock > Cow > Dairy cow > Guernsey
Animals > Livestock > Cow > Dairy cow > Jersey
Animals > Pet
Animals > Pet > Reptile
Animals > Pet > Reptile > Snake
Animals > Pet > Reptile > Turtle
Boats
Boats > Fishing
Boats > Fishing > Sail
Boats > Fishing > Motor
Boats > Leisure
(...) etc.
Now, should I group all in just one table or build a seprate table for each branch or sub-categories? Like:
1 | 0 | 0 | 0 | Animals
1 | 1 | 0 | 0 | Livestock
1 | 1 | 1 | 0 | Cow
1 | 1 | 1 | 1 | Beef cow
1 | 1 | 1 | 2 | Dairy cow
1 | 2 | 0 | 0 | Pet
1 | 2 | 1 | 0 | Reptile
2 | 0 | 0 | 0 | Boats
2 | 1 | 0 | 0 |Fishing
etc.
or just
Main cat table
1 | Animals
2 | Boats
Second cat table
1 | 1 | Livestock
2 | 1 | Pet
3 | 2 | Fishing
Third cat table
1 | 1 | 1 | Cow
2 | 1 | 1 | Goat
3 | 1 | 2 | Snake
4 | 2 | 1 | Sailing
Thanks for any help