Limit (cost=468.60..468.65 rows=20 width=462) |
-> Sort (cost=468.60..473.31 rows=1886 width=462) |
Sort Key: p.updated_at |
-> HashAggregate (cost=352.40..418.41 rows=1886 width=462) |
Group Key: p.id |
-> Hash Join (cost=207.91..300.54 rows=1886 width=462) |
Hash Cond: (p.id = p_4.id) |
-> Hash Left Join (cost=54.75..142.41 rows=1886 width=462) |
Hash Cond: (p.id = tmp4.product_id) |
-> Hash Left Join (cost=25.90..106.46 rows=1886 width=398) |
Hash Cond: (p.id = tmp3.product_id) |
-> Hash Left Join (cost=5.27..77.06 rows=1886 width=334) |
Hash Cond: (p.id = tmp2.product_id) |
-> Hash Left Join (cost=1.95..68.77 rows=1886 width=270) |
Hash Cond: (p.id = tmp1.product_id) |
-> Seq Scan on tbl_products p (cost=0.00..61.86 rows=1886 width=142) |
-> Hash (cost=1.85..1.85 rows=8 width=132) |
-> Subquery Scan on tmp1 (cost=1.60..1.85 rows=8 width=132) |
-> HashAggregate (cost=1.60..1.77 rows=8 width=164) |
Group Key: sub1.product_id |
-> Seq Scan on tbl_erp_inventory_products sub1 (cost=0.00..1.22 rows=22 width=19) |
-> Hash (cost=3.23..3.23 rows=8 width=68) |
-> Subquery Scan on tmp2 (cost=3.03..3.23 rows=8 width=68) |
-> HashAggregate (cost=3.03..3.15 rows=8 width=68) |
Group Key: e.product_id |
-> Hash Left Join (cost=1.50..2.83 rows=26 width=14) |
Hash Cond: (p_1.erp_inventory_product_id = e.id) |
-> Seq Scan on tbl_erp_inventory_product_spents p_1 (cost=0.00..1.26 rows=26 width=14) |
-> Hash (cost=1.22..1.22 rows=22 width=8) |
-> Seq Scan on tbl_erp_inventory_products e (cost=0.00..1.22 rows=22 width=8) |
-> Hash (cost=18.50..18.50 rows=170 width=68) |
-> Subquery Scan on tmp3 (cost=14.25..18.50 rows=170 width=68) |
-> HashAggregate (cost=14.25..16.80 rows=170 width=104) |
Group Key: p_2.product_id |
-> Seq Scan on tbl_erp_inventory_start_products p_2 (cost=0.00..11.70 rows=170 width=100) |
-> Hash (cost=28.80..28.80 rows=4 width=68) |
-> Subquery Scan on tmp4 (cost=28.65..28.80 rows=4 width=68) |
-> GroupAggregate (cost=28.65..28.76 rows=4 width=72) |
Group Key: p_3.product_id |
-> Sort (cost=28.65..28.66 rows=4 width=68) |
Sort Key: p_3.product_id |
-> Hash Join (cost=12.65..28.61 rows=4 width=68) |
Hash Cond: (p_3.erp_inventory_lost_id = e_1.id) |
-> Seq Scan on tbl_erp_inventory_lost_products p_3 (cost=0.00..14.70 rows=470 width=72) |
-> Hash (cost=12.62..12.62 rows=2 width=4) |
-> Seq Scan on tbl_erp_inventory_losts e_1 (cost=0.00..12.62 rows=2 width=4) |
Filter: (status = ANY ('{2,5}'::integer[])) |
-> Hash (cost=129.59..129.59 rows=1886 width=4) |
-> HashAggregate (cost=91.87..110.73 rows=1886 width=4) |
Group Key: p_4.id |
-> Hash Left Join (cost=1.50..87.15 rows=1886 width=4) |
Hash Cond: (p_4.id = eip.product_id) |
-> Seq Scan on tbl_products p_4 (cost=0.00..61.86 rows=1886 width=20) |
-> Hash (cost=1.22..1.22 rows=22 width=4) |
-> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..1.22 rows=22 width=4) |