QUERY PLAN
Aggregate (cost=72.72..72.73 rows=1 width=8)
-> Sort (cost=72.70..72.70 rows=1 width=167)
Sort Key: s.is_draft DESC, s.end_at DESC, s.updated_at DESC NULLS LAST, s.created_at DESC
-> Group (cost=72.64..72.69 rows=1 width=167)
Group Key: s.id
-> Sort (cost=72.64..72.67 rows=9 width=29)
Sort Key: s.id
-> Hash Right Join (cost=31.81..72.50 rows=9 width=29)
Hash Cond: (ccr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_carbon_copy_rels ccr (cost=0.00..30.40 rows=2040 width=4)
-> Hash (cost=31.79..31.79 rows=2 width=29)
-> Hash Right Join (cost=9.52..31.79 rows=2 width=29)
Hash Cond: (rvr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_verify_rels rvr (cost=0.00..19.70 rows=970 width=4)
-> Hash (cost=9.50..9.50 rows=1 width=41)
-> Bitmap Heap Scan on tbl_work_logs s (cost=4.16..9.50 rows=1 width=41)
Recheck Cond: (client_id = 1)
Filter: (NOT is_draft)
-> Bitmap Index Scan on tbl_work_logs_client_id_idx (cost=0.00..4.16 rows=2 width=0)
Index Cond: (client_id = 1)