Faster than a speeding bullet

I’ve been fooling around with this influxDB integral function to produce energy (kWh) from basic power data and I’m blown away by the speed.

I’m running influx on a raspberrypi 3 with an SDcard for storage. The query integrates power readings at ten second intervals over a week = 6 * 60 * 24 * 7 = 60,480 measurements. It takes less than a second. How do they do that?

Can you imagine what an AWS S3 could do?