Answer the question
In order to leave comments, you need to log in
Does it make sense to store MANY-TO-MANY in one field?
There is a table of likes likes (`post_id`, `user_id`)
.
If I make a field in the posts table instead posts(..., `likes` text)
.
Where likes will be a list of user IDs "1,55,66,77,..." and likes will be SET likes = likes + 'user_id'.
Will I be faster in getting a post with likes/deleting a like/putting a like, compared to a separate link table, thereby avoiding bulk insert/delete?
I can't find any pitfalls.
Answer the question
In order to leave comments, you need to log in
Well, just as an expert:
- put text and lose indexing
- it will become impossible to search.
This is only from the first one
. And why did you decide that like has the right to change the post entry. B - security
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question