reduce network traffic for MySQL queries As part of a hobby-project I have a number of servers on my network that measure various parameters (both system statistics and domotica) and store the results (mostly as 5-minute averages) in various tables in a MySQL database running on one of the servers.

Using bash each server periodically queries the MySQL server to get a subset of the stored data in a local file. Then, I use python and gnuplot to turn the raw data in some nice trend graphs.

I currently make hourly, daily and weekly graphs. I already have a lot of data and I would like to make a couple of yearly graphs, however, I'm seeing that queries for a week's worth of data already take some time (query + network + local diskwrites) so I'm hesitant to proceed.

I was wondering if you guys have experience with this type of problem and know of / have experience with standard solutions that I have not found. 

Are there magic queries, compression techniques or local storage solutions that I might want to investigate? The goal being to reduce the network load and reduce the MySQL server workload by preventing it to have to server the same data over and over again.
A few considerations:

Ensure your tables have indexes which serve the queries well. The best designs have an index on any column which appears in a where clause. 

You can also have multiple columns in an index. See composite indexes.

If your accessing the same data multiple times you can look into caching, with something like memcached. 

If you regularly summarise the data and access that same summarised data regularly you could put stored procedures in your database to update a summary table every time you enter new data into your fact table. 

By no means the best possible answer but definitely the first things you should consider on a growing dataset. 

I'll add some referencing links later but I'm on mobile right now.