Limit (cost=126.73..126.73 rows=1 width=257) |
-> Sort (cost=126.73..126.73 rows=1 width=257) |
Sort Key: (CASE WHEN (r.status = 1) THEN 0 WHEN (r.status = 5) THEN 1 ELSE 2 END), r.created_at DESC |
-> Group (cost=126.71..126.72 rows=1 width=257) |
Group Key: r.id |
-> Sort (cost=126.71..126.71 rows=1 width=253) |
Sort Key: r.id |
-> Hash Right Join (cost=103.35..126.70 rows=1 width=253) |
Hash Cond: (rvr.erp_collect_ticket_id = r.id) |
-> Seq Scan on tbl_erp_collect_ticket_verify_rels rvr (cost=0.00..19.70 rows=970 width=4) |
-> Hash (cost=103.34..103.34 rows=1 width=253) |
-> Nested Loop (cost=65.12..103.34 rows=1 width=253) |
-> Hash Join (cost=64.84..102.96 rows=1 width=4) |
Hash Cond: (ectss.sales_contract_id = s.id) |
-> Seq Scan on tbl_erp_collect_ticket_settles ectss (cost=0.00..32.89 rows=1989 width=8) |
-> Hash (cost=64.83..64.83 rows=1 width=4) |
-> Seq Scan on tbl_sales_contracts s (cost=0.00..64.83 rows=1 width=4) |
Filter: (project_id = 3927) |
-> Index Scan using tbl_erp_collect_tickets_pkey on tbl_erp_collect_tickets r (cost=0.28..0.38 rows=1 width=253) |
Index Cond: (id = ectss.erp_collect_ticket_id) |