Hash Left Join (cost=1085.62..414904.46 rows=16467456 width=532) |
Hash Cond: (c.id = tmp9.client_id) |
-> Hash Left Join (cost=644.40..1277.32 rows=109056 width=467) |
Hash Cond: (c.id = tmp8.client_id) |
-> Hash Left Join (cost=419.02..958.21 rows=6816 width=435) |
Hash Cond: (c.id = tmp7.client_id) |
-> Hash Left Join (cost=85.35..577.69 rows=3408 width=411) |
Hash Cond: (c.client_industry = ci.id) |
-> Nested Loop Left Join (cost=83.81..565.68 rows=3408 width=265) |
Join Filter: (tmp4.client_id = c.id) |
-> Nested Loop Left Join (cost=83.81..474.68 rows=48 width=241) |
Join Filter: (ir.client_id = c.id) |
-> Nested Loop Left Join (cost=83.81..164.93 rows=1 width=217) |
Join Filter: (p_2.client_id = c.id) |
-> Nested Loop Left Join (cost=79.52..153.29 rows=1 width=177) |
Join Filter: (p_1.client_id = c.id) |
-> Nested Loop Left Join (cost=75.22..141.65 rows=1 width=137) |
Join Filter: (p.client_id = c.id) |
-> Nested Loop Left Join (cost=70.93..130.00 rows=1 width=61) |
Join Filter: ((csrr.client_id = c.id) AND (csrr.sales_rep = c.sales_rep)) |
-> Index Scan using tbl_clients_pkey on tbl_clients c (cost=0.28..8.29 rows=1 width=65) |
Index Cond: (id = 982) |
-> Hash Join (cost=70.65..121.69 rows=1 width=8) |
Hash Cond: (csrr.id = "ANY_subquery".max) |
-> Seq Scan on tbl_client_sales_rep_rels csrr (cost=0.00..51.02 rows=2 width=12) |
Filter: (client_id = 982) |
-> Hash (cost=68.15..68.15 rows=200 width=4) |
-> HashAggregate (cost=66.15..68.15 rows=200 width=4) |
Group Key: "ANY_subquery".max |
-> Subquery Scan on "ANY_subquery" (cost=49.05..64.25 rows=760 width=4) |
-> HashAggregate (cost=49.05..56.65 rows=760 width=8) |
Group Key: csrrs.client_id |
-> Seq Scan on tbl_client_sales_rep_rels csrrs (cost=0.00..44.62 rows=886 width=8) |
Filter: (end_at IS NULL) |
-> GroupAggregate (cost=4.30..11.63 rows=1 width=80) |
Group Key: p.client_id |
-> Bitmap Heap Scan on tbl_projects p (cost=4.30..11.59 rows=1 width=22) |
Recheck Cond: (client_id = 982) |
Filter: (project_status = 3) |
-> Bitmap Index Scan on tbl_projects_client_id_idx (cost=0.00..4.29 rows=2 width=0) |
Index Cond: (client_id = 982) |
-> GroupAggregate (cost=4.30..11.61 rows=1 width=44) |
Group Key: p_1.client_id |
-> Bitmap Heap Scan on tbl_projects p_1 (cost=4.30..11.59 rows=1 width=13) |
Recheck Cond: (client_id = 982) |
Filter: (project_status = 1) |
-> Bitmap Index Scan on tbl_projects_client_id_idx (cost=0.00..4.29 rows=2 width=0) |
Index Cond: (client_id = 982) |
-> GroupAggregate (cost=4.30..11.61 rows=1 width=44) |
Group Key: p_2.client_id |
-> Bitmap Heap Scan on tbl_projects p_2 (cost=4.30..11.59 rows=1 width=13) |
Recheck Cond: (client_id = 982) |
Filter: (project_status = 2) |
-> Bitmap Index Scan on tbl_projects_client_id_idx (cost=0.00..4.29 rows=2 width=0) |
Index Cond: (client_id = 982) |
-> GroupAggregate (cost=0.00..309.25 rows=48 width=28) |
Group Key: ir.client_id |
-> Seq Scan on tbl_implement_records ir (cost=0.00..308.23 rows=54 width=24) |
Filter: ((NOT is_draft) AND (client_id = 982)) |
-> Materialize (cost=0.00..89.59 rows=71 width=28) |
-> Subquery Scan on tmp4 (cost=0.00..89.23 rows=71 width=28) |
-> GroupAggregate (cost=0.00..88.53 rows=71 width=28) |
Group Key: ps.client_id |
-> Seq Scan on tbl_pre_sales ps (cost=0.00..87.03 rows=79 width=24) |
Filter: ((NOT is_draft) AND (client_id = 982)) |
-> Hash (cost=1.24..1.24 rows=24 width=150) |
-> Seq Scan on tbl_client_industries ci (cost=0.00..1.24 rows=24 width=150) |
-> Hash (cost=333.64..333.64 rows=2 width=28) |
-> Subquery Scan on tmp7 (cost=5.37..333.64 rows=2 width=28) |
-> GroupAggregate (cost=5.37..333.62 rows=2 width=28) |
Group Key: wl.client_id |
-> Bitmap Heap Scan on tbl_work_logs wl (cost=5.37..333.58 rows=2 width=24) |
Recheck Cond: ((client_id IS NOT NULL) AND (client_id = 982)) |
Filter: ((NOT is_draft) AND (location_in_id IS NOT NULL) AND (location_out_id IS NOT NULL)) |
-> Bitmap Index Scan on tbl_work_logs_client_id_idx (cost=0.00..5.37 rows=108 width=0) |
Index Cond: ((client_id IS NOT NULL) AND (client_id = 982)) |
-> Hash (cost=225.18..225.18 rows=16 width=36) |
-> Subquery Scan on tmp8 (cost=0.00..225.18 rows=16 width=36) |
-> GroupAggregate (cost=0.00..225.02 rows=16 width=36) |
Group Key: r.client_id |
-> Seq Scan on tbl_reimbursements r (cost=0.00..224.75 rows=16 width=9) |
Filter: ((status = ANY ('{2,3}'::integer[])) AND (client_id = 982)) |
-> Hash (cost=439.33..439.33 rows=151 width=36) |
-> Subquery Scan on tmp9 (cost=431.78..439.33 rows=151 width=36) |
-> GroupAggregate (cost=431.78..437.82 rows=151 width=36) |
Group Key: c_1.client_id |
-> HashAggregate (cost=431.78..433.67 rows=151 width=40) |
Group Key: c_1.id |
-> Hash Right Join (cost=256.16..431.02 rows=152 width=16) |
Hash Cond: (ca.case_id = c_1.id) |
-> Seq Scan on tbl_case_assignments ca (cost=0.00..154.92 rows=7592 width=12) |
-> Hash (cost=254.28..254.28 rows=151 width=8) |
-> Seq Scan on tbl_cases c_1 (cost=0.00..254.28 rows=151 width=8) |
Filter: (client_id = 982) |