This builds on #35822 Minimize the amount of data selected from the database Testing: History API Response time for 1 day Average of 10 runs with minimal_response Before: 9.47s After: 4.43s