Limit (cost=4283.29..4283.34 rows=20 width=558) |
-> Sort (cost=4283.29..4283.76 rows=187 width=558) |
Sort Key: p.bargain_date DESC |
-> Hash Left Join (cost=3833.25..4278.32 rows=187 width=558) |
Hash Cond: (p.id = tmp5.project_id) |
-> Hash Left Join (cost=3567.20..4005.70 rows=187 width=462) |
Hash Cond: (p.id = tmp4.project_id) |
-> Hash Left Join (cost=1936.17..2374.18 rows=187 width=438) |
Hash Cond: (p.id = tmp3.project_id) |
-> Hash Left Join (cost=1179.25..1616.77 rows=187 width=406) |
Hash Cond: (p.id = tmp2.project_id) |
-> Hash Left Join (cost=451.69..888.72 rows=187 width=382) |
Hash Cond: (p.id = tmp1.project_id) |
-> Seq Scan on tbl_projects p (cost=0.00..436.54 rows=187 width=358) |
Filter: ((collected < budget) AND (project_status = 3) AND (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5329,5332,5420}'::integer[])) AND (created_by = ANY ('{5049,5301,5022,5209,5026,5293,5309,5356,5329,5299,5303,5302,5332,5047,1026,5096,5070,5420,1029,1001,5037,5087,1008,5048,5043,5045,5230,5031,5088,5208,1003,5294,5357,5044,1030,5076,5300,5027,5089,5311,5066,5069,5364,1009,5295,1013,5128,5203,1025,5032,5075,1004,5072,5033,5359,5409,5412,5229,1005,5304,5358,1006,5093}'::integer[]))) |
-> Hash (cost=441.26..441.26 rows=834 width=28) |
-> Subquery Scan on tmp1 (cost=424.58..441.26 rows=834 width=28) |
-> HashAggregate (cost=424.58..432.92 rows=834 width=28) |
Group Key: c.project_id |
-> Hash Right Join (cost=102.22..409.38 rows=1520 width=24) |
Hash Cond: (c.id = ps.case_id) |
-> Seq Scan on tbl_cases c (cost=0.00..235.42 rows=7542 width=8) |
-> Hash (cost=83.22..83.22 rows=1520 width=24) |
-> Seq Scan on tbl_pre_sales ps (cost=0.00..83.22 rows=1520 width=24) |
Filter: (NOT is_draft) |
-> Hash (cost=717.14..717.14 rows=834 width=28) |
-> Subquery Scan on tmp2 (cost=700.46..717.14 rows=834 width=28) |
-> HashAggregate (cost=700.46..708.80 rows=834 width=28) |
Group Key: c_1.project_id |
-> Hash Left Join (cost=329.70..638.70 rows=6176 width=24) |
Hash Cond: (ir.case_id = c_1.id) |
-> Seq Scan on tbl_implement_records ir (cost=0.00..292.78 rows=6176 width=24) |
Filter: (NOT is_draft) |
-> Hash (cost=235.42..235.42 rows=7542 width=8) |
-> Seq Scan on tbl_cases c_1 (cost=0.00..235.42 rows=7542 width=8) |
-> Hash (cost=754.42..754.42 rows=200 width=36) |
-> Subquery Scan on tmp3 (cost=749.92..754.42 rows=200 width=36) |
-> HashAggregate (cost=749.92..752.42 rows=200 width=36) |
Group Key: c_2.project_id |
-> HashAggregate (cost=542.52..636.79 rows=7542 width=40) |
Group Key: c_2.id |
-> Hash Right Join (cost=329.70..504.56 rows=7592 width=16) |
Hash Cond: (ca.case_id = c_2.id) |
-> Seq Scan on tbl_case_assignments ca (cost=0.00..154.92 rows=7592 width=12) |
-> Hash (cost=235.42..235.42 rows=7542 width=8) |
-> Seq Scan on tbl_cases c_2 (cost=0.00..235.42 rows=7542 width=8) |
-> Hash (cost=1625.36..1625.36 rows=453 width=28) |
-> Subquery Scan on tmp4 (cost=1616.30..1625.36 rows=453 width=28) |
-> HashAggregate (cost=1616.30..1620.83 rows=453 width=28) |
Group Key: wl.project_id |
-> Seq Scan on tbl_work_logs wl (cost=0.00..1610.45 rows=585 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=257.18..257.18 rows=710 width=36) |
-> Subquery Scan on tmp5 (cost=241.20..257.18 rows=710 width=36) |
-> HashAggregate (cost=241.20..250.08 rows=710 width=36) |
Group Key: r.project_id |
-> Seq Scan on tbl_reimbursements r (cost=0.00..207.29 rows=6783 width=9) |
Filter: (status = ANY ('{2,3}'::integer[])) |