lastdoor Posted February 2, 2011 Share Posted February 2, 2011 Hello A question popped up in my head, while I was designing my database (this is both php and SQL thought). The scenario is that an item can have many categories. Yet the categories are finite (<100 let's say). I have no problem making a many to many link table. Yet I was wondering if the finite categories would necessitate this method. My thought is - make the categories table a default array and match it against a queried item (containing an array of category IDs) with an array_intersect. Is this efficient, silly, or a variable scenario? Thanks for any insight. Quote Link to comment Share on other sites More sharing options...
requinix Posted February 2, 2011 Share Posted February 2, 2011 Much less efficient. Database systems are designed for that kind of table structure. Let them do their magic. Quote Link to comment Share on other sites More sharing options...
lastdoor Posted February 2, 2011 Author Share Posted February 2, 2011 Thanks, I had a hunch that was the case - but not a lot of relevant experience to put the question at ease. 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.