SQL - Best practice for a Friendship table

后端 未结 5 1413
青春惊慌失措
青春惊慌失措 2020-12-14 03:58

Before you show me duplicates, please note that I\'ve searched through the site an have found some examples but not quite specific to my prob

5条回答
  •  感情败类
    2020-12-14 04:26

    Quassnoi wrote an article explaining why you might want to have a version of the table with two rows per pair, to make queries easier: http://explainextended.com/2009/03/07/selecting-friends/

    (the article talks about MySQL but it is worth bearing in mind as a performance technique for any SQL database)

提交回复
热议问题