Database Reference
In-Depth Information
The test uses getAllNodes to access all the user nodes. In a real application, this
strategy would be even less performant than the test indicates, because it would encounter
a significant number of nodes that were not of type USER .
As we keep saying, decisions around indexing are all about trade-offs. In the next section
you'll see that the performance gains for lookups can easily be negated by the overhead of
the index.
5.6.2. Performance overhead of indexing when updating and inserting
Having achieved close to constant times for finding a user by using an index, you might
wonder what sort of performance overhead you're incurring for the extra index mainten-
ance work you're doing.
The graph in figure 5.6 shows the average time taken to create the user node as the number
of users in the dataset increases. The time doesn't grow much in relation to the number
of users; however, the time taken to create a node and index for the email address takes
roughly twice the time as creating the node alone.
Figure 5.6. Average time for storing user node with and without indexing
 
Search WWH ::




Custom Search