| Sort (cost=103.52..103.53 rows=1 width=85) |
| Sort Key: scpcrd.remind_date DESC |
| -> Nested Loop (cost=8.59..103.51 rows=1 width=85) |
| -> Hash Join (cost=8.31..35.38 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..23.93 rows=1193 width=41) |
| -> Hash (cost=8.30..8.30 rows=1 width=16) |
| -> Index Scan using tbl_sales_contracts_from_project_idx on tbl_sales_contracts sc (cost=0.28..8.30 rows=1 width=16) |
| Index Cond: ((from_project IS NOT NULL) AND (from_project = 4103)) |
| -> Index Scan using tbl_projects_pkey on tbl_projects p (cost=0.28..8.30 rows=1 width=8) |
| Index Cond: (id = 4103) |
| SubPlan 1 |
| -> Aggregate (cost=29.90..29.91 rows=1 width=32) |
| -> Seq Scan on tbl_sales_contract_payment_collection_remind_dates scpcrdsub (cost=0.00..29.89 rows=1 width=6) |
| Filter: ((remind_date <= scpcrd.remind_date) AND (contract_id = scpcrd.contract_id)) |
| SubPlan 2 |
| -> Aggregate (cost=29.90..29.91 rows=1 width=32) |
| -> Seq Scan on tbl_sales_contract_payment_collection_remind_dates scpcrdsub_1 (cost=0.00..29.89 rows=1 width=6) |
| Filter: ((remind_date <= scpcrd.remind_date) AND (contract_id = scpcrd.contract_id)) |