Add a method to get the tree size of the local database.

This is taken to be the number of contiguous entries starting from the first
entry.