Limit (cost=4292.18..4292.23 rows=20 width=555) |
-> Sort (cost=4292.18..4292.97 rows=316 width=555) |
Sort Key: p.bargain_date DESC |
-> Hash Left Join (cost=4038.60..4283.77 rows=316 width=555) |
Hash Cond: (p.id = tmp5.project_id) |
-> Hash Left Join (cost=3746.68..3980.75 rows=316 width=459) |
Hash Cond: (p.id = tmp4.project_id) |
-> Hash Left Join (cost=2063.08..2296.32 rows=316 width=435) |
Hash Cond: (p.id = tmp3.project_id) |
-> Hash Left Join (cost=1257.12..1489.53 rows=316 width=403) |
Hash Cond: (p.id = tmp2.project_id) |
-> Hash Left Join (cost=477.40..708.98 rows=316 width=379) |
Hash Cond: (p.id = tmp1.project_id) |
-> Seq Scan on tbl_projects p (cost=0.00..230.75 rows=316 width=355) |
Filter: ((collected < budget) AND (project_status = 3) AND (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5329,5332,5420,5448,5449}'::integer[]))) |
-> Hash (cost=466.35..466.35 rows=884 width=28) |
-> Subquery Scan on tmp1 (cost=448.67..466.35 rows=884 width=28) |
-> HashAggregate (cost=448.67..457.51 rows=884 width=28) |
Group Key: c.project_id |
-> Hash Right Join (cost=105.57..432.87 rows=1580 width=24) |
Hash Cond: (c.id = ps.case_id) |
-> Seq Scan on tbl_cases c (cost=0.00..251.30 rows=8030 width=8) |
-> Hash (cost=85.82..85.82 rows=1580 width=24) |
-> Seq Scan on tbl_pre_sales ps (cost=0.00..85.82 rows=1580 width=24) |
Filter: (NOT is_draft) |
-> Hash (cost=768.67..768.67 rows=884 width=28) |
-> Subquery Scan on tmp2 (cost=750.99..768.67 rows=884 width=28) |
-> HashAggregate (cost=750.99..759.83 rows=884 width=28) |
Group Key: c_1.project_id |
-> Hash Left Join (cost=351.68..685.01 rows=6598 width=24) |
Hash Cond: (ir.case_id = c_1.id) |
-> Seq Scan on tbl_implement_records ir (cost=0.00..316.00 rows=6598 width=24) |
Filter: (NOT is_draft) |
-> Hash (cost=251.30..251.30 rows=8030 width=8) |
-> Seq Scan on tbl_cases c_1 (cost=0.00..251.30 rows=8030 width=8) |
-> Hash (cost=803.46..803.46 rows=200 width=36) |
-> Subquery Scan on tmp3 (cost=798.96..803.46 rows=200 width=36) |
-> HashAggregate (cost=798.96..801.46 rows=200 width=36) |
Group Key: c_2.project_id |
-> HashAggregate (cost=578.13..678.51 rows=8030 width=40) |
Group Key: c_2.id |
-> Hash Right Join (cost=351.68..537.72 rows=8082 width=16) |
Hash Cond: (ca.case_id = c_2.id) |
-> Seq Scan on tbl_case_assignments ca (cost=0.00..164.82 rows=8082 width=12) |
-> Hash (cost=251.30..251.30 rows=8030 width=8) |
-> Seq Scan on tbl_cases c_2 (cost=0.00..251.30 rows=8030 width=8) |
-> Hash (cost=1677.48..1677.48 rows=490 width=28) |
-> Subquery Scan on tmp4 (cost=1667.68..1677.48 rows=490 width=28) |
-> HashAggregate (cost=1667.68..1672.58 rows=490 width=28) |
Group Key: wl.project_id |
-> Seq Scan on tbl_work_logs wl (cost=0.00..1661.24 rows=644 width=24) |
Filter: ((NOT is_draft) AND (location_in_id IS NOT NULL) AND (location_out_id IS NOT NULL) AND (client_id IS NOT NULL)) |
-> Hash (cost=282.43..282.43 rows=759 width=36) |
-> Subquery Scan on tmp5 (cost=265.35..282.43 rows=759 width=36) |
-> HashAggregate (cost=265.35..274.84 rows=759 width=36) |
Group Key: r.project_id |
-> Seq Scan on tbl_reimbursements r (cost=0.00..227.71 rows=7528 width=9) |
Filter: (status = ANY ('{2,3}'::integer[])) |