Aggregate (cost=34.07..34.08 rows=1 width=8) |
-> Sort (cost=34.03..34.04 rows=3 width=538) |
Sort Key: sub.wrote_date DESC |
-> Result (cost=27.17..34.01 rows=3 width=538) |
-> Append (cost=27.17..33.98 rows=3 width=4) |
-> Subquery Scan on sub (cost=27.17..27.23 rows=1 width=4) |
-> GroupAggregate (cost=27.17..27.22 rows=1 width=538) |
Group Key: r.id |
-> Merge Join (cost=27.17..27.21 rows=1 width=8) |
Merge Cond: (r.id = rp.erp_sales_return_id) |
-> Sort (cost=12.91..12.92 rows=3 width=8) |
Sort Key: r.id |
-> Seq Scan on tbl_erp_sales_returns r (cost=0.00..12.89 rows=3 width=8) |
Filter: (status = ANY ('{1,2,5}'::integer[])) |
-> Sort (cost=14.26..14.27 rows=2 width=8) |
Sort Key: rp.erp_sales_return_id |
-> Seq Scan on tbl_erp_sales_return_products rp (cost=0.00..14.25 rows=2 width=8) |
Filter: (product_id = 2105) |
-> Subquery Scan on "*SELECT* 2" (cost=6.71..6.75 rows=2 width=4) |
-> HashAggregate (cost=6.71..6.73 rows=2 width=538) |
Group Key: r_1.id |
-> Hash Right Join (cost=2.09..6.57 rows=54 width=8) |
Hash Cond: (eip.erp_purchase_gift_product_id = rp_1.id) |
-> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..4.07 rows=107 width=8) |
-> Hash (cost=2.08..2.08 rows=1 width=12) |
-> Nested Loop (cost=0.00..2.08 rows=1 width=12) |
Join Filter: (r_1.id = rp_1.erp_purchase_gift_id) |
-> Seq Scan on tbl_erp_purchase_gift_products rp_1 (cost=0.00..1.02 rows=1 width=8) |
Filter: (product_id = 2105) |
-> Seq Scan on tbl_erp_purchase_gifts r_1 (cost=0.00..1.03 rows=2 width=8) |
Filter: (status = ANY ('{1,2,5}'::integer[])) |