0

I have 7 categories in my website and also 7 tables in mysql. Below the main categories there are 33 subcategories. different subcategories are containing different infos. so should i create 33 tables in mysql for performance or 7 tables enough?

If I should, how can I list a word while searching from 33 tables. This is huge for a query, right?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • Check out http://stackoverflow.com/questions/1567935/how-to-do-inheritance-modeling-in-relational-databases – apokryfos Mar 02 '17 at 13:29
  • Why do you have 7 tables? – Strawberry Mar 02 '17 at 13:29
  • For all the main categories. Sould I increase to 33? – codeigniter Mar 02 '17 at 13:30
  • I would also look at Mike Hillyer's excellent article on a related topic – Strawberry Mar 02 '17 at 13:30
  • One table would seem more than enough – Strawberry Mar 02 '17 at 13:31
  • I'm sorry for the short info but I will also have 33 different forms that can be filled by users and these forms gonna have different inputs. So the table columns have different mission. – codeigniter Mar 02 '17 at 13:34
  • If searching is your main goal I'd suggest you use something like [Solr](http://lucene.apache.org/solr/) (or ElasticSearch or CloudSearch or something) to do the searching so you can focus on a correct relational design instead of worrying about an unrelated aspect of it. – apokryfos Mar 02 '17 at 13:35
  • @apokryfos thanks for the answer. Not only for the search, I'm gonna list the price, adress, title and explanation as a table on website under the main categories and subcategories. The MAİN PURPOSE why I'm asking for 33 tables is these 33 tables have different columns so I need to insert inputs to these tables. So the problem is occuring here for example I have a main category "vehicles" and I'd like to list subcategories "cars, motorcycles, trucks" prices etc.. under the vehicles. – codeigniter Mar 02 '17 at 13:53
  • One table for all categories and subcategories. – Rick James Mar 04 '17 at 00:46

0 Answers0