Thanks Curtis,
we were thinking something similar, but then thought that we could simplify the search algorithm by following additions (using documents because we a currently using Document API):
"find all documents between timestamp_1 and timestamp_2"
1. Add a link between adjacent documents ( i.e. add a property 'next' to a document => points to the next document available in time series)
(2. Keep track of the timestamp list tail somewhere, so we can always quickly determine the latest data point)
3. Create an index of the timestamps in the documents
4. Find the closest document to timestamp_1 using the index (that is >= timestamp_1)
5. Traverse the links until we reach the closest document matching timestamp_2 (that is =< timestamp_2)
Here the obvious problem is the potential size of the index, but in the other hand it is only accessed to find the starting node.
And of course in this case the actual time series tree would only be used for possible aggregate calculations.
The other idea was to create an additional hierarchy, where the documents are linked to an "epoch day" vertex, that represents days from Unix epoch starting date (one instance per a day after 01.01.1970). Then we could partition the search by first calculating the "epoch day" of timestamp_1 and search the best matching timestamp linked to it. This way we would have continuous "epoch day" variable instead of repetitive and inconstant time units and for example queries spanning multiple years would be easier to do. Of course for aggregates the usual "time tree" would be available besides this.
What do you think?
Timo