QUERY PLAN
Nested Loop Left Join (cost=4.58..74.46 rows=15 width=58)
Join Filter: (c.sales_rep = u.id)
-> Bitmap Heap Scan on tbl_clients c (cost=4.58..66.47 rows=15 width=49)
Recheck Cond: ((sales_rep IS NOT NULL) AND (sales_rep = 1001))
Filter: ((NOT deleted) AND (((name)::text ~~* '%bj%'::text) OR (pinyin_shortcut ~~* '%bj%'::text)))
-> Bitmap Index Scan on tbl_clients_sales_rep_idx (cost=0.00..4.58 rows=30 width=0)
Index Cond: ((sales_rep IS NOT NULL) AND (sales_rep = 1001))
-> Materialize (cost=0.00..7.77 rows=1 width=13)
-> Seq Scan on tbl_users u (cost=0.00..7.76 rows=1 width=13)
Filter: (id = 1001)