concept query in category graphs

This is an excerpt from Manning's book Graph Powered Machine Learning.
Each layer satisfies a subset of the requirements and builds using the functionality provided by the other layers. Everything starts from the query = function(all data) equation.
In the scenario the query is “get the locations where the user spends a significant amount of time”.
Ideally, you could run the query on the fly to get the results. This approach is generally infeasible due to the amount of data to be processed and distributed nature of the data sources to be accessed. Moreover, it would take a huge amount of resources, would be unreasonably expensive, and would take a long time. It will also be unsuitable for any real-time monitoring and prediction system.
The most obvious alternative approach is to precompute the result of the query function, or an intermediate value that speeds up the final query results. Let’s call the precomputed query result, final or intermediate, the batch view. Instead of computing the query on the fly, you compute the results from such view. The precomputed views need to be stored in a way that provides quick access to it. The previous equation is then split:
batch view = function(all data) query = function(batch view)All the data in the raw format is stored in the batch layer. This layer is also responsible for the raw data access and the batch view computation and extraction. The resulting views are then stored in the serving layer where they are indexed in a proper way and accessed during the queries.
Figure 4.4 Results from query 4.3 with the sample database created
![]()

This is an excerpt from Manning's book Neo4j in Action.
At each depth, we ran the query 10 times—this was simply to warm up any caches that could help with performance. The fastest execution time for each depth was recorded. No additional database performance tuning was performed, apart from column indexes defined in the SQL script from listing 1.1. Table 1.1 shows the results of the experiment.
The SDN framework provides a number of hooks (code providing access to the underlying GraphDatabaseService instance), which, if required, allow you to drop down and use the low-level core APIs to achieve maximum performance and flexibility. You can still view, query, and (with certain restrictions applied) update the graph outside of SDN using standard Neo4j tools if you so desire. Later in this chapter, the sidebar “Can SDN and Native Neo4j play nicely together?” offers more information on this subject.