比如QQ空间的说说点赞,需要在数据库记录哪些信息?有没有最优解
可以这样创建数据库表
post table
id
post_like table
id
post_id
user_id
post_id
和 user_id
加索引
就酱紫。
查询的时候在post_like
表中查询:
select * from post_like where post_id = 1;
比如QQ空间的说说点赞,需要在数据库记录哪些信息?有没有最优解
可以这样创建数据库表
post table
id
post_like table
id
post_id
user_id
post_id
和 user_id
加索引
就酱紫。
查询的时候在post_like
表中查询:
select * from post_like where post_id = 1;