MAX for Database query timestamps in All Heatmap Q

md5sum a.out
cc228858f0b2920d8b12a282b481f9e1  a.out

Changed from using AVG to using MAX for getting allheatmap query, this
was suggested by @gfritz to ensure no NULLs ever result like they do
from using AVG with time.