| Limit (cost=63.27..63.32 rows=20 width=99) |
| -> Sort (cost=63.27..63.86 rows=235 width=99) |
| Sort Key: (CASE WHEN (r.status = ANY ('{1,5}'::integer[])) THEN 0 ELSE 1 END), r.created_at DESC |
| -> HashAggregate (cost=54.08..57.02 rows=235 width=99) |
| Group Key: r.id |
| -> Hash Left Join (cost=27.32..53.49 rows=235 width=95) |
| Hash Cond: (r.id = crvr.punch_repair_id) |
| -> Hash Right Join (cost=26.23..51.49 rows=235 width=95) |
| Hash Cond: (rccr.punch_repair_id = r.id) |
| Filter: ((r.created_by = ANY ('{1000,1001,1004,1005,1011,1013,1015,1022,1023,5016,5064,5085,5087,5248,5250,5252,5295,5300,5311,5332,5360,5446,5461,5476}'::integer[])) OR (rccr.user_id = 1000) OR (rvr.user_id = 1000)) |
| -> Seq Scan on tbl_punch_repair_carbon_copy_rels rccr (cost=0.00..6.75 rows=375 width=8) |
| -> Hash (cost=21.68..21.68 rows=364 width=99) |
| -> Hash Right Join (cost=14.08..21.68 rows=364 width=99) |
| Hash Cond: (rvr.punch_repair_id = r.id) |
| -> Seq Scan on tbl_punch_repair_verify_rels rvr (cost=0.00..6.64 rows=364 width=8) |
| -> Hash (cost=9.59..9.59 rows=359 width=95) |
| -> Seq Scan on tbl_punch_repairs r (cost=0.00..9.59 rows=359 width=95) |
| -> Hash (cost=1.04..1.04 rows=4 width=4) |
| -> Seq Scan on tbl_punch_repair_cancel_verify_rels crvr (cost=0.00..1.04 rows=4 width=4) |