| Sort (cost=187.11..187.11 rows=1 width=85) |
| Sort Key: scpcrd.remind_date DESC |
| -> Nested Loop (cost=68.76..187.10 rows=1 width=85) |
| -> Hash Join (cost=68.48..103.49 rows=1 width=49) |
| Hash Cond: (scpcrd.contract_id = sc.id) |
| -> Seq Scan on tbl_sales_contract_payment_collection_remind_dates scpcrd (cost=0.00..32.09 rows=1109 width=41) |
| -> Hash (cost=68.46..68.46 rows=1 width=16) |
| -> Seq Scan on tbl_sales_contracts sc (cost=0.00..68.46 rows=1 width=16) |
| Filter: ((from_project IS NOT NULL) AND (from_project = 3957)) |
| -> Index Scan using tbl_projects_pkey on tbl_projects p (cost=0.28..8.30 rows=1 width=8) |
| Index Cond: (id = 3957) |
| SubPlan 1 |
| -> Aggregate (cost=37.64..37.65 rows=1 width=32) |
| -> Seq Scan on tbl_sales_contract_payment_collection_remind_dates scpcrdsub (cost=0.00..37.63 rows=1 width=6) |
| Filter: ((remind_date <= scpcrd.remind_date) AND (contract_id = scpcrd.contract_id)) |
| SubPlan 2 |
| -> Aggregate (cost=37.64..37.65 rows=1 width=32) |
| -> Seq Scan on tbl_sales_contract_payment_collection_remind_dates scpcrdsub_1 (cost=0.00..37.63 rows=1 width=6) |
| Filter: ((remind_date <= scpcrd.remind_date) AND (contract_id = scpcrd.contract_id)) |