标签: sql indexing jointable
假设我有3个表:tbl_posts和tbl_tags,以及多对多关系的加入表:tbl_posts_tags只有2列:post_id和{{ 1}}。
tbl_posts
tbl_tags
tbl_posts_tags
post_id
使用主键(post_id,tag_id)和(唯一?)索引(tag_id,post_id)是否有意义。
答案 0 :(得分:0)
如果你的意思是你应该把你的主键作为聚集索引,那么是的。之后添加一个额外的索引是没有意义的。