QUERY PLAN
Limit (cost=3079.93..3079.96 rows=10 width=16)
-> Sort (cost=3079.93..3079.98 rows=20 width=16)
Sort Key: (sum(num)) DESC
-> GroupAggregate (cost=3079.10..3079.50 rows=20 width=16)
Group Key: user_id, object_type
-> Sort (cost=3079.10..3079.15 rows=20 width=12)
Sort Key: object_type
-> Seq Scan on tbl_visit_module_histories (cost=0.00..3078.67 rows=20 width=12)
Filter: ((object_type <> 24) AND (object_type <> 29) AND (visit_date >= '2025-07-20'::date) AND (user_id = 1001) AND (object_type = ANY ('{23,9,21,10,22,1,19,20,37,18,101,34,7,11,12,13,25,26,16,28,29,30,10004}'::integer[])))