QUERY PLAN
Limit (cost=3078.73..3078.73 rows=2 width=16)
-> Sort (cost=3078.73..3078.73 rows=2 width=16)
Sort Key: (sum(num)) DESC
-> GroupAggregate (cost=3078.68..3078.72 rows=2 width=16)
Group Key: user_id, object_type
-> Sort (cost=3078.68..3078.68 rows=2 width=12)
Sort Key: object_type
-> Seq Scan on tbl_visit_module_histories (cost=0.00..3078.67 rows=2 width=12)
Filter: ((object_type <> 24) AND (object_type <> 29) AND (visit_date >= '2025-07-22'::date) AND (user_id = 5250) 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[])))