Merlin, I tried the hack you suggested but that didn't work. Planner used the same path.
Here is the definition of DB View ‘job’
SELECT w.id,
w.parent_id,
w.status AS state,
w.percent_complete AS progress_percentage,
w.start_time,
w.end_time,
w.est_completion_time AS estimated_completion_time,
w.root_id,
w.internal AS is_internal,
w.order_id AS step_order,
c.resource_type,
c.resource_id,
c.id AS command_id,
c.client_cookie,
c.user_name AS "user",
c.metadata,
c.client_address,
response_body(r.*, w.*) AS response_body
FROM work_unit w
LEFT JOIN command c ON c.work_unit_id = w.id
LEFT JOIN command_response r ON r.command_id::text = c.id::text;
Query that uses the DB view:
SELECT id, start_time
FROM job
order by id LIMIT 101 OFFSET 0;
Explain plan: https://explain.depesz.com/s/gzjQ
Query using the raw SQL
<SQL from Job DB View definition>
ORDER BY id LIMIT 101 OFFSET 0;
Explain plan:https://explain.depesz.com/s/KgwO