Graph-relational translation

So how can a graph query translate into a relational one?

Imagine that we have already found the vertex A, B, and C. Now we are searching for the edge from C to D. This query is illustrated in the following image:

This is pretty straightforward as we can scan the vertex table and search for entries where the Src (source) field is C. Once we have found out that the Dst (destination) field points to D (let's assume that we are also interested in the properties of the node D), we finally join the vertex table in order to obtain these properties of D.

The following image illustrates such a practically complete query and the resulting join operations:

You might wonder at the fact that we are using a lot of joins in order to construct the query. This is true. However, there is a subsequent stage that is responsible for join elimination. So don't worry too much about this yet.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.15.43