Split timeSpent query into 2 separate queries, as postgresql isn't able to figure out a decent query plan. With 120k jobs in queue, this makes some queries go from 100s to 1-2s.

Created by  Eelco Dolstra  on May 1, 2015
QMC6IMJQ3CTMLLEERF5YT7JS3RJW4UJ2BKEJA43WRQ5OL72G6ZMAC
Change contents