A simple SQL Select query to crawl all connected people in a social graph?
So you want get all friends of someone, including n-th degree friends? I don't think it is possible without recursion.
How you can do that is explained here:
https://inviqa.com/blog/graphs-database-sql-meets-social-network
How do sites like LinkedIn efficiently display 1st/2nd/3rd-level relationship next to each person's name?
You may be able to leverage axioms about small world networks to optimize this type of traversal.
Small world networks are characterized by "hubs" the represent very dense interconnections of other nodes. Most nodes in the network will generally either connect within a few hops to a topologically nearby node (1-4 hops away) or will route through one or more such hubs. This is one of the main reasons that small world networks behave the way they do.
Related Topics
Is Too Many Left Joins a Code Smell
Sql Server Select Datetime Without Seconds
Database View Does Not Reflect The Data in The Underying Table
Can't Connect to SQL 2012 Remotely by Ip and Named Instance
Index Spanning Multiple Tables in Postgresql
Sqlserver - How to Find Dependent Tables on My Table
Query to Check Overlapping Ranges in SQL Server
How to Use Oracle Outer Join with a Filter Where Clause
Sql Server Database Change Workflow Best Practices
Sql Server Login Disable Windows Authentication
Best Way to Change Clustered Index (Pk) in SQL 2005
Oracle Unique Constraint Based on Column Value
Whats The Best Sqlite Data Type for a Long String
Count Max. Number of Concurrent User Sessions Per Day
How to Treat a Union Query as a Sub Query
How to Determine If Null Is Contained in an Array in Postgres
Error- Ora-22835: Buffer Too Small for Clob to Char or Blob to Raw Conversion