QUERY PLAN
Limit (cost=329.10..329.10 rows=1 width=313)
-> Sort (cost=329.10..329.10 rows=1 width=313)
Sort Key: s.is_draft DESC, s.end_at DESC, s.updated_at DESC
-> Group (cost=329.08..329.09 rows=1 width=313)
Group Key: s.id
-> Sort (cost=329.08..329.08 rows=1 width=297)
Sort Key: s.id
-> Hash Right Join (cost=149.72..329.07 rows=1 width=297)
Hash Cond: (ccr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_carbon_copy_rels ccr (cost=0.00..144.34 rows=9334 width=4)
-> Hash (cost=149.70..149.70 rows=1 width=297)
-> Hash Right Join (cost=12.98..149.70 rows=1 width=297)
Hash Cond: (rvr.work_log_id = s.id)
-> Seq Scan on tbl_work_log_verify_rels rvr (cost=0.00..116.82 rows=7582 width=4)
-> Hash (cost=12.97..12.97 rows=1 width=297)
-> Bitmap Heap Scan on tbl_work_logs s (cost=8.95..12.97 rows=1 width=297)
Recheck Cond: ((project_id = 3814) AND (client_id = 2815))
Filter: ((NOT is_draft) AND (created_by = 1000))
-> BitmapAnd (cost=8.95..8.95 rows=1 width=0)
-> Bitmap Index Scan on tbl_work_logs_project_id_idx (cost=0.00..4.31 rows=3 width=0)
Index Cond: (project_id = 3814)
-> Bitmap Index Scan on tbl_work_logs_client_id_idx (cost=0.00..4.39 rows=13 width=0)
Index Cond: (client_id = 2815)