| Subquery Scan on sub (cost=621.42..621.48 rows=1 width=548) |
| Filter: (sub.id = 2080) |
| -> WindowAgg (cost=621.42..621.46 rows=2 width=548) |
| -> Sort (cost=621.42..621.43 rows=2 width=540) |
| Sort Key: sub_1.updated_at DESC |
| -> Subquery Scan on sub_1 (cost=621.24..621.41 rows=2 width=540) |
| -> GroupAggregate (cost=621.24..621.39 rows=2 width=540) |
| Group Key: p.id |
| -> Sort (cost=621.24..621.25 rows=2 width=540) |
| Sort Key: p.id |
| -> Hash Left Join (cost=608.75..621.23 rows=2 width=540) |
| Hash Cond: (p.id = tmp5.product_id) |
| -> Hash Left Join (cost=590.81..603.27 rows=2 width=476) |
| Hash Cond: (p.id = tmp4.product_id) |
| -> Hash Left Join (cost=588.14..600.59 rows=2 width=412) |
| Hash Cond: (p.id = tmp3.product_id) |
| -> Hash Right Join (cost=584.06..596.49 rows=2 width=348) |
| Hash Cond: (sub1.product_id = p.id) |
| -> HashAggregate (cost=21.67..29.03 rows=368 width=164) |
| Group Key: sub1.product_id |
| -> Seq Scan on tbl_erp_inventory_products sub1 (cost=0.00..12.97 rows=497 width=16) |
| -> Hash (cost=562.36..562.36 rows=2 width=220) |
| -> Hash Right Join (cost=551.77..562.36 rows=2 width=220) |
| Hash Cond: (e.product_id = p.id) |
| -> HashAggregate (cost=37.28..42.80 rows=368 width=68) |
| Group Key: e.product_id |
| -> Hash Left Join (cost=19.18..33.15 rows=551 width=13) |
| Hash Cond: (p_1.erp_inventory_product_id = e.id) |
| -> Seq Scan on tbl_erp_inventory_product_spents p_1 (cost=0.00..12.51 rows=551 width=13) |
| -> Hash (cost=12.97..12.97 rows=497 width=8) |
| -> Seq Scan on tbl_erp_inventory_products e (cost=0.00..12.97 rows=497 width=8) |
| -> Hash (cost=514.47..514.47 rows=2 width=156) |
| -> Nested Loop (cost=498.11..514.47 rows=2 width=156) |
| -> Group (cost=497.83..497.84 rows=2 width=4) |
| Group Key: p_2.id |
| -> Sort (cost=497.83..497.84 rows=2 width=4) |
| Sort Key: p_2.id |
| -> Hash Left Join (cost=347.43..497.82 rows=2 width=4) |
| Hash Cond: (eip.id = esosps.erp_inventory_product_id) |
| -> Hash Left Join (cost=334.18..484.53 rows=2 width=8) |
| Hash Cond: (epips.project_id = sc.from_project) |
| Filter: ((lower((p_2.name)::text) ~~* '%爱国者%'::text) OR (p_2.pinyin_shortcut ~~* '%爱国者%'::text) OR (lower((pt.name)::text) ~~* '%爱国者%'::text) OR (lower((pb.name)::text) ~~* '%爱国者%'::text) OR (lower((ps.name)::text) ~~* '%爱国者%'::text) OR (lower((pc.name)::text) ~~* '%爱国者%'::text) OR (lower(p_2.description) ~~* '%爱国者%'::text) OR (lower((sc.serial_no)::text) ~~* '%爱国者%'::text)) |
| -> Hash Left Join (cost=194.37..237.63 rows=2121 width=171) |
| Hash Cond: (p_2.product_component = pc.id) |
| -> Hash Left Join (cost=188.77..226.31 rows=2121 width=159) |
| Hash Cond: (p_2.product_serie = ps.id) |
| -> Hash Left Join (cost=126.86..158.83 rows=2121 width=134) |
| Hash Cond: (p_2.product_type = pt.id) |
| -> Hash Left Join (cost=124.44..150.46 rows=2121 width=126) |
| Hash Cond: (p_2.product_brand = pb.id) |
| -> Hash Right Join (cost=116.54..136.88 rows=2121 width=122) |
| Hash Cond: (eip.product_id = p_2.id) |
| -> Hash Left Join (cost=17.82..36.85 rows=497 width=12) |
| Hash Cond: (eip.erp_purchase_inbound_id = epis.id) |
| -> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..12.97 rows=497 width=32) |
| -> Hash (cost=15.17..15.17 rows=212 width=8) |
| -> Hash Right Join (cost=10.77..15.17 rows=212 width=8) |
| Hash Cond: (epips.erp_purchase_inbound_id = epis.id) |
| -> Seq Scan on tbl_erp_purchase_inbound_projects epips (cost=0.00..3.89 rows=189 width=8) |
| -> Hash (cost=8.12..8.12 rows=212 width=4) |
| -> Seq Scan on tbl_erp_purchase_inbounds epis (cost=0.00..8.12 rows=212 width=4) |
| -> Hash (cost=72.21..72.21 rows=2121 width=114) |
| -> Seq Scan on tbl_products p_2 (cost=0.00..72.21 rows=2121 width=114) |
| -> Hash (cost=5.18..5.18 rows=218 width=12) |
| -> Seq Scan on tbl_product_brands pb (cost=0.00..5.18 rows=218 width=12) |
| -> Hash (cost=1.63..1.63 rows=63 width=16) |
| -> Seq Scan on tbl_product_types pt (cost=0.00..1.63 rows=63 width=16) |
| -> Hash (cost=41.96..41.96 rows=1596 width=33) |
| -> Seq Scan on tbl_product_series ps (cost=0.00..41.96 rows=1596 width=33) |
| -> Hash (cost=3.60..3.60 rows=160 width=20) |
| -> Seq Scan on tbl_product_components pc (cost=0.00..3.60 rows=160 width=20) |
| -> Hash (cost=118.25..118.25 rows=1725 width=20) |
| -> Seq Scan on tbl_sales_contracts sc (cost=0.00..118.25 rows=1725 width=20) |
| -> Hash (cost=8.11..8.11 rows=411 width=8) |
| -> Seq Scan on tbl_erp_sales_outbound_spent_products esosps (cost=0.00..8.11 rows=411 width=8) |
| -> Index Scan using tbl_products_pkey on tbl_products p (cost=0.28..8.30 rows=1 width=156) |
| Index Cond: (id = p_2.id) |
| -> Hash (cost=3.48..3.48 rows=49 width=68) |
| -> Subquery Scan on tmp3 (cost=2.25..3.48 rows=49 width=68) |
| -> HashAggregate (cost=2.25..2.99 rows=49 width=104) |
| Group Key: p_3.product_id |
| -> Seq Scan on tbl_erp_inventory_start_products p_3 (cost=0.00..1.50 rows=50 width=46) |
| -> Hash (cost=2.55..2.55 rows=9 width=68) |
| -> Subquery Scan on tmp4 (cost=2.33..2.55 rows=9 width=68) |
| -> HashAggregate (cost=2.33..2.46 rows=9 width=72) |
| Group Key: p_4.product_id |
| -> Hash Join (cost=1.06..2.24 rows=9 width=68) |
| Hash Cond: (p_4.erp_inventory_lost_id = e_1.id) |
| -> Seq Scan on tbl_erp_inventory_lost_products p_4 (cost=0.00..1.13 rows=13 width=72) |
| -> Hash (cost=1.04..1.04 rows=2 width=4) |
| -> Seq Scan on tbl_erp_inventory_losts e_1 (cost=0.00..1.04 rows=2 width=4) |
| Filter: (status = ANY ('{2,5}'::integer[])) |
| -> Hash (cost=16.69..16.69 rows=100 width=68) |
| -> Subquery Scan on tmp5 (cost=14.19..16.69 rows=100 width=68) |
| -> HashAggregate (cost=14.19..15.69 rows=100 width=72) |
| Group Key: p_5.product_id |
| -> Hash Join (cost=1.16..13.19 rows=100 width=68) |
| Hash Cond: (p_5.erp_inventory_overflow_id = e_2.id) |
| -> Seq Scan on tbl_erp_inventory_overflow_products p_5 (cost=0.00..11.60 rows=160 width=72) |
| -> Hash (cost=1.10..1.10 rows=5 width=4) |
| -> Seq Scan on tbl_erp_inventory_overflows e_2 (cost=0.00..1.10 rows=5 width=4) |
| Filter: (status = ANY ('{2,5}'::integer[])) |