Aggregate (cost=501.49..501.50 rows=1 width=8) |
-> Sort (cost=501.48..501.48 rows=1 width=726) |
Sort Key: p.bargain_date DESC, p.updated_at DESC |
-> Hash Left Join (cost=315.40..501.47 rows=1 width=726) |
Hash Cond: (p.created_by = u2.id) |
Filter: (((c.name)::text ~~* '%北京网%'::text) OR (c.pinyin_shortcut ~~* '%北京网%'::text) OR (p.pinyin_shortcut ~~* '%北京网%'::text) OR ((p.project_title)::text ~~* '%北京网%'::text) OR ((u2.name)::text ~~* '%北京网%'::text)) |
-> Hash Right Join (cost=306.22..492.19 rows=41 width=102) |
Hash Cond: (c.id = p.client_id) |
-> Seq Scan on tbl_clients c (cost=0.00..178.31 rows=1931 width=59) |
-> Hash (cost=305.71..305.71 rows=41 width=51) |
-> Subquery Scan on p (cost=304.48..305.71 rows=41 width=51) |
-> GroupAggregate (cost=304.48..305.30 rows=41 width=423) |
Group Key: p_1.id, r.user_id, (sum(r.pct)) |
-> Sort (cost=304.48..304.58 rows=41 width=91) |
Sort Key: p_1.id, r.user_id, (sum(r.pct)) |
-> Hash Join (cost=235.39..303.38 rows=41 width=91) |
Hash Cond: (sc.from_project = p_1.id) |
-> Seq Scan on tbl_sales_contracts sc (cost=0.00..63.71 rows=1037 width=4) |
Filter: (NOT is_outbound) |
-> Hash (cost=233.94..233.94 rows=116 width=91) |
-> Hash Right Join (cost=218.68..233.94 rows=116 width=91) |
Hash Cond: (t.project_id = p_1.id) |
-> HashAggregate (cost=25.64..33.23 rows=607 width=40) |
Group Key: t.project_id, r.user_id |
-> Hash Right Join (cost=1.20..21.09 rows=607 width=40) |
Hash Cond: (r.erp_profit_distribute_id = t.id) |
-> Seq Scan on tbl_erp_profit_distribute_pcts r (cost=0.00..17.80 rows=780 width=40) |
-> Hash (cost=1.11..1.11 rows=7 width=8) |
-> Seq Scan on tbl_erp_profit_distributes t (cost=0.00..1.11 rows=7 width=8) |
Filter: ((project_id IS NOT NULL) AND (status = 2)) |
-> Hash (cost=191.59..191.59 rows=116 width=55) |
-> Seq Scan on tbl_projects p_1 (cost=0.00..191.59 rows=116 width=55) |
Filter: ((bargain_date >= '2025-01-01'::date) AND (bargain_date <= '2025-12-31'::date) AND (project_status = 3)) |
-> Hash (cost=7.41..7.41 rows=141 width=13) |
-> Seq Scan on tbl_users u2 (cost=0.00..7.41 rows=141 width=13) |