You can group directly on the foreign key in the log. Rows whose service_id is NULL form a group of their own. MIN and MAX use the recorded durations within each group.
From deployments, return service_id, the shortest recorded duration as min_seconds and the longest as max_seconds. Include the group of unassigned runs and groups with no measured time.