QUERY PLAN
Group (cost=17.84..17.87 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=17.84..17.85 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
-> Hash Right Join (cost=9.91..17.83 rows=1 width=35)
Hash Cond: (u.id = urcl.user_id)
-> Seq Scan on tbl_users u (cost=0.00..7.39 rows=139 width=35)
-> Hash (cost=9.90..9.90 rows=1 width=4)
-> Seq Scan on tbl_user_role_change_logs urcl (cost=0.00..9.90 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) && '["2025-06-24 22:15:59","2025-06-24 22:15:59"]'::tsrange))