QUERY PLAN
Group (cost=28.43..28.45 rows=1 width=404)
Group Key: u.pinyin1, u.namecut1, u.pinyin2, u.namecut2, u.pinyin3, u.namecut3, u.pinyin4, u.namecut4, urcl.user_id
-> Sort (cost=28.43..28.43 rows=1 width=404)
Sort Key: u.pinyin1 NULLS FIRST, u.namecut1 NULLS FIRST, u.pinyin2 NULLS FIRST, u.namecut2 NULLS FIRST, u.pinyin3 NULLS FIRST, u.namecut3 NULLS FIRST, u.pinyin4 NULLS FIRST, u.namecut4 NULLS FIRST
-> Nested Loop Left Join (cost=0.14..28.42 rows=1 width=404)
Join Filter: (urcl.user_id = u.id)
-> Seq Scan on tbl_user_role_change_logs urcl (cost=0.00..20.25 rows=1 width=4)
Filter: ((user_id = 5493) AND ((role_name)::text = 'AccountManager'::text) AND (daterange((start_from)::date, (end_at)::date, '[)'::text) && '[2026-05-29,2026-05-30)'::daterange))
-> Index Scan using tbl_users_pkey on tbl_users u (cost=0.14..8.15 rows=1 width=404)
Index Cond: (id = 5493)