Database Reference
In-Depth Information
Figure 1.3. Traversing the social network graph data
Before the traversal starts, you select the node from which the traversal will start (node
X in figure 1.3 ). Then you follow all the friendship relationships (arrows) and collect the
visited nodes as results. The traversal continues its journey from one node to another via
the relationships that connect them. The direction of relationships does not affect the tra-
versal—you can go up and down the arrows with the same efficiency. When the rules stop
applying, the traversal stops. For example, the rule can be to visit only nodes that are at
depth 1 from the starting node, in which case once all nodes at depth 1 are visited, the tra-
versal stops. (The darker arrows in figure 1.3 show the relationships that are followed for
this example.)
Table 1.2 shows the performance metrics for running a traversal against a graph containing
thesamedatathatwasinthepreviousMySQLdatabase(wherethetraversalisfunctionally
the same as the queries executed previously on the database, finding friends of friends up
 
Search WWH ::




Custom Search