select cast(avg(abs(timestampdiff(second, a.logtime, b.logtime))) as signed) as gap from order_log a join select_log b on a.order_id=b.order_id