QUERY PLAN
Limit (cost=2787.26..2787.27 rows=1 width=16)
-> Sort (cost=2787.26..2787.27 rows=1 width=16)
Sort Key: (sum(num)) DESC
-> GroupAggregate (cost=2787.23..2787.25 rows=1 width=16)
Group Key: user_id, object_type
-> Sort (cost=2787.23..2787.23 rows=1 width=12)
Sort Key: object_type
-> Seq Scan on tbl_visit_module_histories (cost=0.00..2787.22 rows=1 width=12)
Filter: ((object_type <> 24) AND (object_type <> 29) AND (visit_date >= '2025-06-10'::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[])))