skulk Posted August 8, 2007 Share Posted August 8, 2007 Planning on starting a review website using tags. After a little research read that you should have 3 tables to optimaly use tabs (true?). So I took that a couple of steps forward and decided to put everything into new tables, since all the fields (editor review, user review and data) will be quite big. So I figured if everything was in one table, it would really have rubbish performance. Did I take it too far? Or is it the correct way? Total number of (main_name) fields will be a couple of hundered. Shouldn't cross 1000, does that change anything? Proposed structure is as follows: main id name location map id main_id tag_id editor_id userrev_id data_id tag tag_id name editor editor_id review userrev userrev_id user rating review menu data_id data Quote Link to comment Share on other sites More sharing options...
Eric_Ryk Posted August 8, 2007 Share Posted August 8, 2007 I'm not entirely sure about the exact implementation you are looking to use in your database, as I'm not entirely sure why you've set them up that way, but here is how you properly use tags with three tables. taggables id ... tags id name taggables_tags taggable_id tag_id What this does is let you reuse tags on multiple 'taggables', or in other words it is a many-to-many relationship. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.