QUERY PLAN
GroupAggregate (cost=2123.99..2138.21 rows=12 width=68)
Group Key: u.id
-> Merge Left Join (cost=2123.99..2137.31 rows=12 width=228)
Merge Cond: (u.id = t.user_id)
-> Merge Left Join (cost=2122.56..2135.83 rows=12 width=132)
Merge Cond: (u.id = am_3.user_id)
-> Merge Left Join (cost=308.96..319.61 rows=12 width=100)
Merge Cond: (u.id = am_1.user_id)
-> Merge Left Join (cost=93.15..103.25 rows=12 width=68)
Merge Cond: (u.id = t_1.handler)
-> Index Only Scan using tbl_users_pkey on tbl_users u (cost=0.14..9.95 rows=12 width=4)
Index Cond: (id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> GroupAggregate (cost=93.00..93.18 rows=7 width=68)
Group Key: t_1.handler
-> Sort (cost=93.00..93.02 rows=7 width=68)
Sort Key: t_1.handler
-> Append (cost=40.62..92.90 rows=7 width=68)
-> HashAggregate (cost=40.62..40.71 rows=6 width=68)
Group Key: t_1.handler
-> Hash Right Join (cost=25.66..39.64 rows=130 width=13)
Hash Cond: (eipss.erp_sales_outbound_id = t_1.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.51 rows=551 width=13)
-> Hash (cost=25.21..25.21 rows=36 width=8)
-> Seq Scan on tbl_erp_sales_outbounds t_1 (cost=12.89..25.21 rows=36 width=8)
Filter: (((NOT (hashed SubPlan 1)) OR (project_id IS NULL)) AND (created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2) AND (handler = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])))
SubPlan 1
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_20.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_20.project_id
-> Seq Scan on tbl_erp_profit_distributes t_20 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> GroupAggregate (cost=52.09..52.12 rows=1 width=68)
Group Key: am.user_id
-> Sort (cost=52.09..52.09 rows=1 width=18)
Sort Key: am.user_id
-> Nested Loop (cost=36.06..52.08 rows=1 width=18)
Join Filter: (pd.id = am.erp_profit_distribute_id)
-> Seq Scan on tbl_erp_profit_distribute_pcts am (cost=0.00..1.20 rows=7 width=13)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> Materialize (cost=36.06..50.67 rows=2 width=13)
-> Hash Right Join (cost=36.06..50.66 rows=2 width=13)
Hash Cond: (eipss_1.erp_sales_outbound_id = t_2.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss_1 (cost=0.00..12.51 rows=551 width=13)
-> Hash (cost=36.05..36.05 rows=1 width=8)
-> Hash Join (cost=22.88..36.05 rows=1 width=8)
Hash Cond: (pd.project_id = t_2.project_id)
-> Seq Scan on tbl_erp_profit_distributes pd (cost=0.00..12.30 rows=230 width=8)
-> Hash (cost=22.87..22.87 rows=1 width=12)
-> Hash Join (cost=12.91..22.87 rows=1 width=12)
Hash Cond: (t_2.project_id = t_3.project_id)
-> Seq Scan on tbl_erp_sales_outbounds t_2 (cost=0.00..9.66 rows=107 width=8)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=12.90..12.90 rows=1 width=4)
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_3.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_3.project_id
-> Seq Scan on tbl_erp_profit_distributes t_3 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> GroupAggregate (cost=215.81..216.23 rows=7 width=36)
Group Key: am_1.user_id
-> Merge Append (cost=215.81..216.10 rows=7 width=36)
Sort Key: am_1.user_id
-> GroupAggregate (cost=60.02..60.12 rows=5 width=36)
Group Key: am_1.user_id
-> Sort (cost=60.02..60.03 rows=5 width=36)
Sort Key: am_1.user_id
-> Nested Loop Left Join (cost=27.38..59.96 rows=5 width=36)
Filter: (((NOT (hashed SubPlan 2)) OR (t_4.sales_contract_id IS NULL)) AND ((NOT (hashed SubPlan 3)) OR (t_4.sales_contract_id IS NULL)))
-> Hash Join (cost=1.31..4.16 rows=5 width=40)
Hash Cond: (t_4.id = am_1.erp_other_income_ticket_id)
-> Seq Scan on tbl_erp_other_income_tickets t_4 (cost=0.00..2.70 rows=26 width=8)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=1.23..1.23 rows=7 width=40)
-> Seq Scan on tbl_erp_other_income_ticket_handlers am_1 (cost=0.00..1.23 rows=7 width=40)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> Index Scan using tbl_sales_contracts_pkey on tbl_sales_contracts sc (cost=0.28..5.99 rows=1 width=8)
Index Cond: (id = t_4.sales_contract_id)
SubPlan 2
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_21.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_21.project_id
-> Seq Scan on tbl_erp_profit_distributes t_21 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
SubPlan 3
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_22.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_22.project_id
-> Seq Scan on tbl_erp_profit_distributes t_22 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> GroupAggregate (cost=154.50..154.52 rows=1 width=36)
Group Key: am_2.user_id
-> Sort (cost=154.50..154.50 rows=1 width=15)
Sort Key: am_2.user_id
-> Nested Loop (cost=14.20..154.49 rows=1 width=15)
Join Filter: (sc_1.id = t_5.sales_contract_id)
-> Nested Loop (cost=14.20..151.46 rows=1 width=13)
Join Filter: (pd_1.project_id = sc_1.from_project)
-> Hash Join (cost=12.91..135.70 rows=1 width=12)
Hash Cond: (sc_1.from_project = t_6.project_id)
-> Seq Scan on tbl_sales_contracts sc_1 (cost=0.00..118.25 rows=1725 width=8)
-> Hash (cost=12.90..12.90 rows=1 width=4)
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_6.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_6.project_id
-> Seq Scan on tbl_erp_profit_distributes t_6 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> Hash Join (cost=1.29..15.67 rows=7 width=13)
Hash Cond: (pd_1.id = am_2.erp_profit_distribute_id)
-> Seq Scan on tbl_erp_profit_distributes pd_1 (cost=0.00..12.30 rows=230 width=8)
-> Hash (cost=1.20..1.20 rows=7 width=13)
-> Seq Scan on tbl_erp_profit_distribute_pcts am_2 (cost=0.00..1.20 rows=7 width=13)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> Seq Scan on tbl_erp_other_income_tickets t_5 (cost=0.00..2.70 rows=26 width=10)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> GroupAggregate (cost=1.27..1.29 rows=1 width=36)
Group Key: t_7.handler
-> Sort (cost=1.27..1.27 rows=1 width=9)
Sort Key: t_7.handler
-> Seq Scan on tbl_erp_inventory_overflows t_7 (cost=0.00..1.26 rows=1 width=9)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2) AND (handler = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])))
-> GroupAggregate (cost=1813.60..1815.16 rows=78 width=36)
Group Key: am_3.user_id
-> Sort (cost=1813.60..1813.80 rows=78 width=36)
Sort Key: am_3.user_id
-> Append (cost=942.54..1811.15 rows=78 width=36)
-> HashAggregate (cost=942.54..943.29 rows=60 width=36)
Group Key: am_3.user_id
-> Hash Left Join (cost=671.11..941.19 rows=270 width=9)
Hash Cond: (t_8.sales_contract_id = sc_2.id)
Filter: ((NOT (hashed SubPlan 4)) OR (t_8.sales_contract_id IS NULL))
-> Hash Join (cost=518.40..787.67 rows=308 width=13)
Hash Cond: (am_3.erp_cash_cost_ticket_id = t_8.id)
-> Seq Scan on tbl_erp_cash_cost_ticket_handlers am_3 (cost=0.00..260.73 rows=3254 width=13)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> Hash (cost=508.38..508.38 rows=802 width=8)
-> Seq Scan on tbl_erp_cash_cost_tickets t_8 (cost=0.00..508.38 rows=802 width=8)
Filter: (is_payment_settle AND (created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (created_at >= '2025-08-08 14:34:58+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=118.25..118.25 rows=1725 width=8)
-> Seq Scan on tbl_sales_contracts sc_2 (cost=0.00..118.25 rows=1725 width=8)
SubPlan 4
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_23.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_23.project_id
-> Seq Scan on tbl_erp_profit_distributes t_23 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> GroupAggregate (cost=662.88..662.91 rows=1 width=36)
Group Key: am_4.user_id
-> Sort (cost=662.88..662.89 rows=1 width=14)
Sort Key: am_4.user_id
-> Nested Loop (cost=137.00..662.87 rows=1 width=14)
Join Filter: (pd_2.project_id = sc_3.from_project)
-> Hash Join (cost=135.72..647.11 rows=1 width=13)
Hash Cond: (t_9.sales_contract_id = sc_3.id)
-> Seq Scan on tbl_erp_cash_cost_tickets t_9 (cost=0.00..508.38 rows=802 width=9)
Filter: (is_payment_settle AND (created_at >= '2025-08-08 14:34:58+08'::timestamp with time zone) AND (created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=135.70..135.70 rows=1 width=12)
-> Hash Join (cost=12.91..135.70 rows=1 width=12)
Hash Cond: (sc_3.from_project = t_10.project_id)
-> Seq Scan on tbl_sales_contracts sc_3 (cost=0.00..118.25 rows=1725 width=8)
-> Hash (cost=12.90..12.90 rows=1 width=4)
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_10.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_10.project_id
-> Seq Scan on tbl_erp_profit_distributes t_10 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> Hash Join (cost=1.29..15.67 rows=7 width=13)
Hash Cond: (pd_2.id = am_4.erp_profit_distribute_id)
-> Seq Scan on tbl_erp_profit_distributes pd_2 (cost=0.00..12.30 rows=230 width=8)
-> Hash (cost=1.20..1.20 rows=7 width=13)
-> Seq Scan on tbl_erp_profit_distribute_pcts am_4 (cost=0.00..1.20 rows=7 width=13)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> GroupAggregate (cost=20.19..20.31 rows=6 width=36)
Group Key: am_5.user_id
-> Sort (cost=20.19..20.21 rows=6 width=36)
Sort Key: am_5.user_id
-> Hash Join (cost=15.27..20.12 rows=6 width=36)
Hash Cond: (t_11.id = am_5.erp_cost_ticket_id)
-> Seq Scan on tbl_erp_cost_tickets t_11 (cost=12.89..17.54 rows=39 width=4)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND ((NOT (hashed SubPlan 5)) OR (project_id IS NULL)) AND (status = 2))
SubPlan 5
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_24.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_24.project_id
-> Seq Scan on tbl_erp_profit_distributes t_24 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> Hash (cost=2.23..2.23 rows=12 width=40)
-> Seq Scan on tbl_erp_cost_ticket_handlers am_5 (cost=0.00..2.23 rows=12 width=40)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> GroupAggregate (cost=32.00..32.03 rows=1 width=36)
Group Key: am_6.user_id
-> Sort (cost=32.00..32.01 rows=1 width=14)
Sort Key: am_6.user_id
-> Nested Loop (cost=17.53..31.99 rows=1 width=14)
Join Filter: (pd_3.id = am_6.erp_profit_distribute_id)
-> Hash Join (cost=17.53..30.70 rows=1 width=9)
Hash Cond: (pd_3.project_id = t_12.project_id)
-> Seq Scan on tbl_erp_profit_distributes pd_3 (cost=0.00..12.30 rows=230 width=8)
-> Hash (cost=17.52..17.52 rows=1 width=13)
-> Hash Join (cost=12.91..17.52 rows=1 width=13)
Hash Cond: (t_12.project_id = t_13.project_id)
-> Seq Scan on tbl_erp_cost_tickets t_12 (cost=0.00..4.44 rows=60 width=9)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=12.90..12.90 rows=1 width=4)
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_13.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_13.project_id
-> Seq Scan on tbl_erp_profit_distributes t_13 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> Seq Scan on tbl_erp_profit_distribute_pcts am_6 (cost=0.00..1.20 rows=7 width=13)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> GroupAggregate (cost=24.76..24.79 rows=1 width=36)
Group Key: am_7.user_id
-> Sort (cost=24.76..24.77 rows=1 width=36)
Sort Key: am_7.user_id
-> Nested Loop (cost=13.17..24.75 rows=1 width=36)
Join Filter: (t_14.id = am_7.erp_cost_convert_ticket_id)
-> Nested Loop Left Join (cost=13.17..22.38 rows=1 width=4)
Filter: ((NOT (hashed SubPlan 6)) OR (t_14.sales_contract_id IS NULL))
-> Seq Scan on tbl_erp_cost_convert_tickets t_14 (cost=0.00..1.18 rows=1 width=8)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Index Scan using tbl_sales_contracts_pkey on tbl_sales_contracts sc_4 (cost=0.28..8.29 rows=1 width=8)
Index Cond: (id = t_14.sales_contract_id)
SubPlan 6
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_25.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_25.project_id
-> Seq Scan on tbl_erp_profit_distributes t_25 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> Seq Scan on tbl_erp_cost_convert_ticket_handlers am_7 (cost=0.00..2.23 rows=12 width=40)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> GroupAggregate (cost=36.62..36.65 rows=1 width=36)
Group Key: am_8.user_id
-> Sort (cost=36.62..36.62 rows=1 width=41)
Sort Key: am_8.user_id
-> Nested Loop (cost=13.19..36.61 rows=1 width=41)
Join Filter: (pd_4.id = am_8.erp_profit_distribute_id)
-> Nested Loop (cost=13.19..35.32 rows=1 width=36)
Join Filter: (pd_4.project_id = sc_5.from_project)
-> Hash Join (cost=12.91..25.83 rows=1 width=12)
Hash Cond: (pd_4.project_id = t_16.project_id)
-> Seq Scan on tbl_erp_profit_distributes pd_4 (cost=0.00..12.30 rows=230 width=8)
-> Hash (cost=12.90..12.90 rows=1 width=4)
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_16.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_16.project_id
-> Seq Scan on tbl_erp_profit_distributes t_16 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> Nested Loop (cost=0.28..9.48 rows=1 width=36)
-> Seq Scan on tbl_erp_cost_convert_tickets t_15 (cost=0.00..1.18 rows=1 width=36)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Index Scan using tbl_sales_contracts_pkey on tbl_sales_contracts sc_5 (cost=0.28..8.29 rows=1 width=8)
Index Cond: (id = t_15.sales_contract_id)
-> Seq Scan on tbl_erp_profit_distribute_pcts am_8 (cost=0.00..1.20 rows=7 width=13)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> HashAggregate (cost=39.93..40.02 rows=7 width=36)
Group Key: t_17.handler
-> Hash Right Join (cost=23.95..37.92 rows=269 width=13)
Hash Cond: (eipss_2.erp_sales_gift_id = t_17.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss_2 (cost=0.00..12.51 rows=551 width=13)
-> Hash (cost=23.20..23.20 rows=60 width=8)
-> Seq Scan on tbl_erp_sales_gifts t_17 (cost=12.89..23.20 rows=60 width=8)
Filter: (((NOT (hashed SubPlan 7)) OR (project_id IS NULL)) AND (created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2) AND (handler = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[])))
SubPlan 7
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_26.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_26.project_id
-> Seq Scan on tbl_erp_profit_distributes t_26 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> GroupAggregate (cost=50.35..50.38 rows=1 width=36)
Group Key: am_9.user_id
-> Sort (cost=50.35..50.35 rows=1 width=18)
Sort Key: am_9.user_id
-> Nested Loop (cost=34.46..50.34 rows=1 width=18)
Join Filter: (pd_5.id = am_9.erp_profit_distribute_id)
-> Hash Right Join (cost=34.46..49.05 rows=1 width=13)
Hash Cond: (eipss_3.erp_sales_gift_id = t_18.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss_3 (cost=0.00..12.51 rows=551 width=13)
-> Hash (cost=34.45..34.45 rows=1 width=8)
-> Hash Join (cost=21.28..34.45 rows=1 width=8)
Hash Cond: (pd_5.project_id = t_18.project_id)
-> Seq Scan on tbl_erp_profit_distributes pd_5 (cost=0.00..12.30 rows=230 width=8)
-> Hash (cost=21.27..21.27 rows=1 width=12)
-> Hash Join (cost=12.91..21.27 rows=1 width=12)
Hash Cond: (t_18.project_id = t_19.project_id)
-> Seq Scan on tbl_erp_sales_gifts t_18 (cost=0.00..8.15 rows=71 width=8)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))
-> Hash (cost=12.90..12.90 rows=1 width=4)
-> Group (cost=12.88..12.89 rows=1 width=4)
Group Key: t_19.project_id
-> Sort (cost=12.88..12.89 rows=1 width=4)
Sort Key: t_19.project_id
-> Seq Scan on tbl_erp_profit_distributes t_19 (cost=0.00..12.88 rows=1 width=4)
Filter: ((project_id IS NOT NULL) AND (status = 2))
-> Seq Scan on tbl_erp_profit_distribute_pcts am_9 (cost=0.00..1.20 rows=7 width=13)
Filter: (user_id = ANY ('{5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> Sort (cost=1.43..1.43 rows=1 width=100)
Sort Key: t.user_id
-> Seq Scan on tbl_erp_user_profits t (cost=0.00..1.42 rows=1 width=100)
Filter: ((created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-12-31 23:59:59+08'::timestamp with time zone))