-3

If I have 3 entities:

  • Story
  • Blog
  • Article

And let's say that these entities have the same attributes or columns. Should I combine these 3 in 1 entity? And imagine that each row (1 row) contains a lot of data. Is it better in terms of performance?

I'm currently leaning towards separate, because I can imagine adding another column in the future for one of these entities. Is it, performance wise, better to keep them separate if they contain many and large data?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
user3125591
  • 113
  • 5
  • 13

2 Answers2

1

If all three tables are created equally and equally indexed, then there is no reason that performance will be difference. But if the tables are not going to change radically, then for maintenance reasons I would put them in the same table - use nullable field.

Scary Wombat
  • 44,617
  • 6
  • 35
  • 64
0

And lets say that these entities have the same attributes or columns. Should I combine these 3 in 1 entity? And imagine that each row (1 row) contains a lot of data. Is it in terms of performance better?

in this statement you said "these entities have the same attributes or columns" and then...

I'm currently leaning towards separate because I can imagine adding another column in the future for one of these entities.

you are saying u will add column to just one of them(you are a little rain on sunshine) then they will have different attributes/columns and surely they are different entities. but if all of them will have same attributes,(base on my knowledge and what i will do) i will just combine them and have another column "category" that will identify if the Write up is Article, Blog or Story and make another table "WriteupCategory" incase i need to add another category :D

As much as possible make your database final/permanent and normalized, spend many time for it. if u alter tables/Columns of your database, you need to change all concerned module: from adding, editing/deleting, reports and Etc.

(Im not pro, but this is what i had learned from school XD)

Ceeee
  • 1,392
  • 2
  • 15
  • 32