QUERY PLAN
Sort (cost=10.49..10.50 rows=1 width=112)
Sort Key: u.pinyin1, u.namecut1, u.pinyin2, u.namecut2, u.pinyin3, u.namecut3, u.pinyin4, u.namecut4
-> Group (cost=10.47..10.48 rows=1 width=112)
Group Key: u.id, sg.y_budget, sg.y_profit
-> Sort (cost=10.47..10.48 rows=1 width=108)
Sort Key: sg.y_budget, sg.y_profit
-> Nested Loop Left Join (cost=0.00..10.46 rows=1 width=108)
Join Filter: (sgr.user_id = u.id)
-> Seq Scan on tbl_users u (cost=0.00..7.76 rows=1 width=44)
Filter: (id = 1001)
-> Nested Loop (cost=0.00..2.69 rows=1 width=68)
Join Filter: (sgr.sales_goal_id = sg.id)
-> Seq Scan on tbl_sales_goal_rels sgr (cost=0.00..1.52 rows=1 width=8)
Filter: (user_id = 1001)
-> Seq Scan on tbl_sales_goals sg (cost=0.00..1.15 rows=1 width=68)
Filter: ((id IS NOT NULL) AND (goal_year = '2025'::smallint))