QUERY PLAN
Sort (cost=41.59..41.61 rows=9 width=21)
Sort Key: u.name
-> Group (cost=41.38..41.45 rows=9 width=21)
Group Key: s.id, u.id
-> Sort (cost=41.38..41.40 rows=9 width=21)
Sort Key: s.id, u.id
-> Hash Right Join (cost=33.24..41.24 rows=9 width=21)
Hash Cond: (u.id = s.accessible_user)
-> Seq Scan on tbl_users u (cost=0.00..7.41 rows=141 width=13)
-> Hash (cost=33.12..33.12 rows=9 width=8)
-> Seq Scan on tbl_erp_sales_order_visibles s (cost=0.00..33.12 rows=9 width=8)
Filter: ((accessible_user IS NOT NULL) AND (user_id = 1004))