PyTables User's Guide: Hierarchical datasets in Python - Release 1.3.3
Prev | Chapter 5. Optimization tips | Next

# 5.7. Selecting an User Entry Point (UEP) in your tree

Note: After the introduction of the new object tree cache in PyTables 1.2, this feature is not very useful anymore and might become deprecated in future versions.

If you have a huge tree in your data file with many nodes on it, creating the object tree would take long time. Many times, however, you are interested only in access to a part of the complete tree, so you won't strictly need PyTables to build the entire object tree in-memory, but only the interesting part.

This is where the `rootUEP` parameter of `openFile` function (see 4.1.2) can be helpful. Imagine that you have a file called `"test.h5"` with the associated tree that you can see in figure 5.17, and you are interested only in the section marked in red. You can avoid the build of all the object tree by saying to `openFile` that your root will be the `/Group2/Group3` group. That is:

    	    fileh = openFile("test.h5", rootUEP="/Group2/Group3")

As a result, the actual object tree built will be like the one that can be seen in figure 5.18.

Of course this has been a simple example and the use of the `rootUEP` parameter was not very necessary. But when you have thousands of nodes on a tree, you will certainly appreciate the `rootUEP` parameter.

Figure 5.17. Complete tree in file test.h5, and subtree of interest for the user.

Figure 5.18. Resulting object tree derived from the use of the rootUEP parameter.

Prev | Home | Next
Getting the most from the node LRU cache | Up | Compacting your PyTables files