QUERY PLAN
Limit (cost=3079.55..3079.58 rows=10 width=16)
-> Sort (cost=3079.55..3079.59 rows=15 width=16)
Sort Key: (sum(num)) DESC
-> GroupAggregate (cost=3078.96..3079.26 rows=15 width=16)
Group Key: user_id, object_type
-> Sort (cost=3078.96..3079.00 rows=15 width=12)
Sort Key: object_type
-> Seq Scan on tbl_visit_module_histories (cost=0.00..3078.67 rows=15 width=12)
Filter: ((object_type <> 24) AND (object_type <> 29) AND (visit_date >= '2025-07-22'::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[])))