If you're running the SeasonsEcowitt skin (or any skin derived from it) and noticing high CPU usage and slow report generation, check line 233 of hilo.inc:
This check uses $year to determine whether to display observations in the statistics table. On a database with 6+ years of data (~640,000 archive records), this triggers MySQL to scan the entire year's worth of raw archive records for every observation in the hilo table — even though the year timespan is not displayed in the statistics table at all.
Impact on my 6-year MySQL database:
Fix: Replace $year with $week on that line:
Since $week data is already loaded for the statistics table, this change adds zero additional queries.
Result:
Environment: weewx 5.4.0, Python 3.14.4, Fedora 43, MySQL backend, ~640,000 archive records (6 years), SeasonsEcowitt skin 5.1.0