Further refinements to traffic SQL query