lundi 2 février 2015

All in one table or separate tables for each categories for a clasifieds website?


I am developing a classified website by using ASP.net and my DB is MYSQL. In there I am using a header table to store common records of an ad. like ad title, description, published date like wise. And I am using separate tables for store job category, real estate and vehicle categories etc.


Now I noticed that the column of many categories are identical. so now I have two approach


1) Follow the current approach ( 1 header table and separate tables for each categories )


2) Add extra columns to the header table and store all data in one table and maintain a column to identify the category of the ad. Currently I have a Bigint as a primary key in header table. Then I am referencing it through other separate tables.It means they also have Bigints. They were also primary keys. So everything are indexed. If I use one table then some fields will get NULL values.


So which is better by considering the performance when each category have millions of records.? If you have questions to clarify to give an answer please ask. Thank you very much.





Aucun commentaire:

Enregistrer un commentaire