peripleo2 icon indicating copy to clipboard operation
peripleo2 copied to clipboard

Possible optimization of time histogram

Open rsimon opened this issue 8 years ago • 0 comments

The time histogram is currently computed using a scripted aggregation:

f = doc['temporal_bounds.from']
t = doc['temporal_bounds.to']
buckets = []
if (!(f.empty || t.empty))
   for (i=f.date.year; i<t.date.year; i+= $interval) { buckets.add(i) }
buckets;

The trick of generating a series of timestamps across the item's temporal bounds, at the interval of the histogram, could be done at indexing time, as well. This might make the query-time aggregation a faster.

We'll need to see if the effect is significant (especially for the initial match-all query), or whether it is negligible in practice. At least it's worth a try.

rsimon avatar Feb 23 '17 16:02 rsimon