Limit (cost=295.29..295.34 rows=20 width=284) |
-> Sort (cost=295.19..295.71 rows=208 width=284) |
Sort Key: r.updated_at DESC |
-> HashAggregate (cost=285.93..288.01 rows=208 width=284) |
Group Key: r.id |
-> Hash Right Join (cost=237.26..285.41 rows=208 width=284) |
Hash Cond: (epop.erp_sales_order_id = r.id) |
-> Seq Scan on tbl_erp_sales_order_products epop (cost=0.00..39.23 rows=1823 width=8) |
-> Hash (cost=235.04..235.04 rows=178 width=284) |
-> Hash Left Join (cost=208.67..235.04 rows=178 width=284) |
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=78.77..101.03 rows=1559 width=288) |
Hash Cond: (rvr.erp_sales_order_id = r.id) |
-> Seq Scan on tbl_erp_sales_order_verify_rels rvr (cost=0.00..19.70 rows=970 width=8) |
-> Hash (cost=59.28..59.28 rows=1559 width=284) |
-> Seq Scan on tbl_erp_sales_orders r (cost=0.00..59.28 rows=1559 width=284) |
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) |