Limit (cost=518.59..518.64 rows=20 width=462) |
-> Sort (cost=518.59..523.31 rows=1886 width=462) |
Sort Key: p.updated_at DESC |
-> HashAggregate (cost=402.40..468.41 rows=1886 width=462) |
Group Key: p.id |
-> Hash Join (cost=257.90..350.53 rows=1886 width=462) |
Hash Cond: (p.id = p_4.id) |
-> Hash Left Join (cost=107.11..194.78 rows=1886 width=462) |
Hash Cond: (p.id = tmp4.product_id) |
-> Hash Left Join (cost=78.26..158.82 rows=1886 width=398) |
Hash Cond: (p.id = tmp3.product_id) |
-> Hash Left Join (cost=57.64..129.42 rows=1886 width=334) |
Hash Cond: (p.id = tmp2.product_id) |
-> Hash Left Join (cost=22.60..89.42 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=20.35..20.35 rows=180 width=132) |
-> Subquery Scan on tmp1 (cost=14.95..20.35 rows=180 width=132) |
-> HashAggregate (cost=14.95..18.55 rows=180 width=164) |
Group Key: sub1.product_id |
-> Seq Scan on tbl_erp_inventory_products sub1 (cost=0.00..11.80 rows=180 width=100) |
-> Hash (cost=32.79..32.79 rows=180 width=68) |
-> Subquery Scan on tmp2 (cost=28.29..32.79 rows=180 width=68) |
-> HashAggregate (cost=28.29..30.99 rows=180 width=68) |
Group Key: e.product_id |
-> Hash Left Join (cost=14.05..26.71 rows=210 width=68) |
Hash Cond: (p_1.erp_inventory_product_id = e.id) |
-> Seq Scan on tbl_erp_inventory_product_spents p_1 (cost=0.00..12.10 rows=210 width=68) |
-> Hash (cost=11.80..11.80 rows=180 width=8) |
-> Seq Scan on tbl_erp_inventory_products e (cost=0.00..11.80 rows=180 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=127.22..127.22 rows=1886 width=4) |
-> HashAggregate (cost=89.50..108.36 rows=1886 width=4) |
Group Key: p_4.id |
-> Hash Left Join (cost=14.05..84.78 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=11.80..11.80 rows=180 width=4) |
-> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..11.80 rows=180 width=4) |