QUERY PLAN
Limit (cost=2483.63..2483.63 rows=1 width=16)
-> Sort (cost=2483.63..2483.63 rows=1 width=16)
Sort Key: (sum(num)) DESC
-> GroupAggregate (cost=2483.60..2483.62 rows=1 width=16)
Group Key: user_id, object_type
-> Sort (cost=2483.60..2483.60 rows=1 width=12)
Sort Key: object_type
-> Seq Scan on tbl_visit_module_histories (cost=0.00..2483.59 rows=1 width=12)
Filter: ((object_type <> 24) AND (object_type <> 29) AND (visit_date >= '2025-06-19'::date) AND (user_id = 1005) AND (object_type = ANY ('{23,9,21,10,1,19,20,37,18,101,34,7,11,12,13,25,16,28}'::integer[])))