L
L
l4m3r2019-05-21 21:54:16
SQL
l4m3r, 2019-05-21 21:54:16

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

1 answer(s)
I
Ivan Shumov, 2019-05-21
@l4m3r

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 question

Ask a Question

731 491 924 answers to any question