Results 1 to 2 of 2

Thread: Most efficient way to link records together like in FaceBook?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Question Most efficient way to link records together like in FaceBook?

    Hi Everyone,

    On sites like FaceBook you can add friends where many people are linked to others. How is the best way to do this? Is there a single table that has all of the links with two fields - if you have 5 friends, your ID is in one field of 5 records and each of their IDs are in the other fields? For a popular site that table will have millions of records!

    The only other way is to add all of your friend's IDs to one field with a seperator and split them up to list. I suppose you could have multiple fields holding these IDs with several in each one.

    Or is there another way I'm not thinking about? I work with MSSQL mostly but we also have a client with the latest AS400 and that AS400 blows away anything I have ever seen as far as speed!!

    Warren

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Most efficient way to link records together like in FaceBook?

    The standard for a many-to-many relationship is as you descriped; your id in 5 rows with 1 row for each of the 5 friends.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width