QUERY PLAN
Group (cost=18.53..18.56 rows=1 width=35)
Group Key: u.pinyin1, u.namecut1, u.pinyin2, u.namecut2, u.pinyin3, u.namecut3, u.pinyin4, u.namecut4, urcl.user_id
-> Sort (cost=18.53..18.54 rows=1 width=35)
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, urcl.user_id
-> Nested Loop Left Join (cost=0.14..18.52 rows=1 width=35)
-> Seq Scan on tbl_user_role_change_logs urcl (cost=0.00..10.25 rows=1 width=4)
Filter: (((start_from < end_at) OR (end_at IS NULL)) AND ((role_name)::text = 'Engineer'::text) AND (tsrange((start_from)::timestamp without time zone, (end_at)::timestamp without time zone, '[)'::text) && '["2026-06-01 11:49:45","2026-06-01 11:49:45"]'::tsrange))
-> Index Scan using tbl_users_pkey on tbl_users u (cost=0.14..8.16 rows=1 width=35)
Index Cond: (urcl.user_id = id)