I did some trials using system.tag.queryTagHistory for 2 months of data, Aug 1st to Oct 1st.
Tags were a mix of bools, integers and reals
3 tags took 5.7s, 5 tags took 4.7s, 6 tags took 4.4s, 7 tags took 5.4s.
Here are the results and script.
Number of tags: 3
Query start time: 2018-10-10 12:21:22:022
Query end time: 2018-10-10 12:21:27:027
Query duration in millisecs: 5750
Number of tags: 5
Query start time: 2018-10-10 12:21:55:055
Query end time: 2018-10-10 12:22:00:000
Query duration in millisecs: 4703
Number of tags: 6
Query start time: 2018-10-10 12:23:23:023
Query end time: 2018-10-10 12:23:28:028
Query duration in millisecs: 4406
Number of tags: 7
Query start time: 2018-10-10 12:24:24:024
Query end time: 2018-10-10 12:24:29:029
Query duration in millisecs: 5453
startQueryTime = system.date.now()
tags =[mix of Bool, Integer, Real tags removed for IP reasons]
returnSize = 10000
dataset = system.tag.queryTagHistory(paths = tags, startDate ='2018-08-01', endDate='2018-10-01', returnSize=returnSize, aggregationMode='Maximum')
endQueryTime = system.date.now()
print 'Number of tags: ' + str(len(tags))
print 'returnSize :' +str(returnSize)
print 'Query start time: ' +str(system.date.format(startQueryTime,'yyyy-MM-dd HH:mm:ss:sss'))
print 'Query end time: ' +str(system.date.format(endQueryTime,'yyyy-MM-dd HH:mm:ss:sss'))
print 'Query duration in millisecs: ' + str(system.date.millisBetween(startQueryTime,endQueryTime))
For direct history queries our most common day to day use would be easy charts with up to a week of data and they respond well. Load in less than 1 second.
This might be off topic but might help. For reports that show aggregates of weeks or months of data we archive history data into other tables to make the queries faster. We run gateway timer scripts every 5 mins or 1 hour etc. The scripts query history for the info we are interested in say energy used per motor then store the results in a different table giving us energy used per motor per hour.
Maybe that approach could help?