Calculating the average execution time without using a join