Logs query execution times

This change tracks the query execution time and logs it. It may
provide helpful debug information while tracking slowness on
the API side to correlate with db performance.