Aggregate (cost=173.09..173.10 rows=1 width=8) |
-> Sort (cost=172.64..172.72 rows=30 width=352) |
Sort Key: r.updated_at DESC |
-> Group (cost=171.76..171.91 rows=30 width=352) |
Group Key: r.id |
-> Sort (cost=171.76..171.83 rows=30 width=12) |
Sort Key: r.id |
-> Hash Left Join (cost=146.19..171.02 rows=30 width=12) |
Hash Cond: (r.client_id = client.id) |
Filter: ((client.sales_rep = 1004) OR (r.created_by = 1004) OR (rvr.user_id = 1004) OR (r.created_by = 1004)) |
-> Hash Right Join (cost=16.29..38.59 rows=965 width=24) |
Hash Cond: (rvr.erp_sales_return_id = r.id) |
-> Seq Scan on tbl_erp_sales_return_verify_rels rvr (cost=0.00..19.70 rows=970 width=8) |
-> Hash (cost=13.68..13.68 rows=209 width=20) |
-> Seq Scan on tbl_erp_sales_returns r (cost=0.00..13.68 rows=209 width=20) |
Filter: ((status <> 0) OR ((status = 0) AND (created_by = 1004))) |
-> Hash (cost=105.51..105.51 rows=1951 width=8) |
-> Seq Scan on tbl_clients client (cost=0.00..105.51 rows=1951 width=8) |