SELECT v0."id", v0."name", v0."enabled", v0."registration", v0."model", v0."inserted_at", v0."updated_at", v0."deleted_at", coalesce(s1."pending_jobs_today_count"::bigint, $1::bigint)::bigint FROM "prod"."vehicles" AS v0 LEFT OUTER JOIN LATERAL (SELECT coalesce(count(sj0."id"::uuid), $2::bigint)::bigint AS "pending_jobs_today_count", sj0."vehicle_id" AS "vehicle_id" FROM "prod"."jobs" AS sj0 WHERE ((sj0."deleted_at"::timestamptz IS NULL) = $3::boolean) AND (v0."id" = sj0."vehicle_id") GROUP BY sj0."vehicle_id") AS s1 ON TRUE WHERE ((v0."deleted_at"::timestamptz IS NULL) = $4::boolean) [0, 0, true, true]
SELECT v0."id", v0."name", v0."enabled", v0."registration", v0."model", v0."inserted_at", v0."updated_at", v0."deleted_at", coalesce(s1."pending_jobs_today_count"::bigint, $1::bigint)::bigint FROM "prod"."vehicles" AS v0 LEFT OUTER JOIN LATERAL (SELECT coalesce(count(sj0."id"::uuid), $2::bigint)::bigint AS "pending_jobs_today_count", sj0."vehicle_id" AS "vehicle_id" FROM "prod"."jobs" AS sj0 WHERE ((sj0."deleted_at"::timestamptz IS NULL) = $3::boolean) AND (v0."id" = sj0."vehicle_id") GROUP BY sj0."vehicle_id") AS s1 ON TRUE WHERE ((v0."deleted_at"::timestamptz IS NULL) = $4::boolean) [0, 0, true, true]