QUERY PLAN
Limit (cost=72.70..72.71 rows=1 width=167)
-> Sort (cost=72.70..72.71 rows=1 width=167)
Sort Key: s.is_draft DESC, s.end_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=151)
Sort Key: s.id
-> Hash Right Join (cost=31.81..72.50 rows=9 width=151)
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=151)
-> Hash Right Join (cost=9.52..31.79 rows=2 width=151)
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=151)
-> Bitmap Heap Scan on tbl_work_logs s (cost=4.16..9.50 rows=1 width=151)
Recheck Cond: (project_id = 1)
Filter: (NOT is_draft)
-> Bitmap Index Scan on tbl_work_logs_project_id_idx (cost=0.00..4.16 rows=2 width=0)
Index Cond: (project_id = 1)