QUERY PLAN
Aggregate (cost=622.58..622.59 rows=1 width=8)
-> Sort (cost=621.26..621.48 rows=88 width=167)
Sort Key: s.is_draft DESC, s.end_at DESC
-> Group (cost=617.98..618.42 rows=88 width=167)
Group Key: s.id
-> Sort (cost=617.98..618.20 rows=88 width=13)
Sort Key: s.id
-> Hash Right Join (cost=435.22..615.13 rows=88 width=13)
Hash Cond: (ccr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_carbon_copy_rels ccr (cost=0.00..144.59 rows=9359 width=4)
-> Hash (cost=434.12..434.12 rows=88 width=13)
-> Hash Right Join (cost=286.20..434.12 rows=88 width=13)
Hash Cond: (rvr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_verify_rels rvr (cost=0.00..126.52 rows=8152 width=4)
-> Hash (cost=285.10..285.10 rows=88 width=25)
-> Bitmap Heap Scan on tbl_work_logs s (cost=4.97..285.10 rows=88 width=25)
Recheck Cond: (client_id = 2128)
Filter: (NOT is_draft)
-> Bitmap Index Scan on tbl_work_logs_client_id_idx (cost=0.00..4.95 rows=88 width=0)
Index Cond: (client_id = 2128)