Limit (cost=324.05..324.10 rows=20 width=418) |
-> Sort (cost=324.05..324.59 rows=214 width=418) |
Sort Key: r.updated_at DESC |
-> HashAggregate (cost=316.22..318.36 rows=214 width=418) |
Group Key: r.id |
-> Hash Right Join (cost=267.47..315.69 rows=214 width=418) |
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=265.17..265.17 rows=184 width=418) |
-> Hash Left Join (cost=238.79..265.17 rows=184 width=418) |
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=108.89..131.15 rows=1563 width=422) |
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=89.35..89.35 rows=1563 width=418) |
-> Seq Scan on tbl_erp_sales_orders r (cost=0.00..89.35 rows=1563 width=418) |
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) |