EducateYourself
EducateYourself

Reputation: 979

Mysql database design: table with half a million rows

I realize that there are similar questions answered on this site but I could not get the solution for me from those questions. For example, I have 10.000 posts in the website and each of those posts has 50 reviews. Should I create

1.One table with 500.000 rows (reviews)

or

2 .10.000 tables (each post has its own table for reviews (50 rows)) Could you help me to understand please.

Upvotes: 0

Views: 251

Answers (2)

NiceTry
NiceTry

Reputation: 360

  1. It's not a good idea to create tables during runtime, so you should create one table in this case
  2. Reviews table - 500.000 rows is ok
  3. Vote Up table - Actually, the number of rows will not reach to 100.000.000 because it's impossible that each post will be voted by all the users, so you can create one table in this case as well

Upvotes: 0

Scimmia Alpha
Scimmia Alpha

Reputation: 211

I'd create a table named POST and a table named REVIEW. Each post has an ID (primary key of the table POST) that you can use as foreign key in the table REVIEW to index all reviews relative to a post. And as Tim Castelijns just said, 500k row are nothing for a normal DB and its performances are not really going affected by this.

Upvotes: 1

Related Questions