One column is value in integer. Second column is timestamp in datetime.
I want to efficiently get the sum of the values in the first column over a datetime range (start time to end time).
Is there some way to tell postgres to maintain a range query segment tree over one column.
Also imagine if the table had another column called userId. My queries would look 'give me the sum total over a date range for this userid'.