QUERY PLAN
Aggregate (cost=337.01..337.02 rows=1 width=8)
-> Sort (cost=336.97..336.97 rows=3 width=167)
Sort Key: s.is_draft DESC, s.end_at DESC
-> Group (cost=336.93..336.94 rows=3 width=167)
Group Key: s.id
-> Sort (cost=336.93..336.94 rows=3 width=13)
Sort Key: s.id
-> Hash Right Join (cost=157.47..336.90 rows=3 width=13)
Hash Cond: (ccr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_carbon_copy_rels ccr (cost=0.00..144.40 rows=9340 width=4)
-> Hash (cost=157.43..157.43 rows=3 width=13)
-> Hash Right Join (cost=15.96..157.43 rows=3 width=13)
Hash Cond: (rvr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_verify_rels rvr (cost=0.00..121.00 rows=7800 width=4)
-> Hash (cost=15.92..15.92 rows=3 width=25)
-> Bitmap Heap Scan on tbl_work_logs s (cost=4.31..15.92 rows=3 width=25)
Recheck Cond: (project_id = 263)
Filter: (NOT is_draft)
-> Bitmap Index Scan on tbl_work_logs_project_id_idx (cost=0.00..4.31 rows=3 width=0)
Index Cond: (project_id = 263)