Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUERY PLAN
- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
- Hash Full Join (cost=120077.27..288149.57 rows=1433 width=247)
- Hash Cond: (cld.product_custom_identificator = collected.pci)
- Filter: ((COALESCE((sum(cld.count)), 0::real) <> 0::double precision) OR (COALESCE(collected.total, 0::numeric) <> 0::numeric))
- -> HashAggregate (cost=23731.30..23745.64 rows=1434 width=15)
- InitPlan 25 (returns $39)
- -> Index Scan using uniq_t_currentlevel_stocktakingid_storeid on t_currentlevel cl (cost=0.27..8.29 rows=1 width=8)
- Index Cond: (stocktaking_id = 'TeKarvinaKosmo07092014;87'::text)
- -> Bitmap Heap Scan on t_currentlevel_data cld (cost=913.72..23435.31 rows=38360 width=15)
- Recheck Cond: (batch_id = $39)
- -> Bitmap Index Scan on ind_currentleveldata_batchid_pci (cost=0.00..904.13 rows=38360 width=0)
- Index Cond: (batch_id = $39)
- -> Hash (cost=96345.84..96345.84 rows=10 width=232)
- -> Subquery Scan on collected (cost=96345.72..96345.84 rows=10 width=232)
- -> Sort (cost=96345.72..96345.74 rows=10 width=129)
- Sort Key: ((SubPlan 17))
- InitPlan 23 (returns $33)
- -> Index Scan using t_store_info_pkey on t_store_info s_9 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> GroupAggregate (cost=95479.18..96337.26 rows=10 width=129)
- -> Sort (cost=95479.18..95479.20 rows=10 width=129)
- Sort Key: w.stocktaking_id, ((SubPlan 22))
- -> Nested Loop (cost=313.42..95479.01 rows=10 width=129)
- -> Bitmap Heap Scan on t_weighting w (cost=312.99..94922.43 rows=46 width=77)
- Recheck Cond: ((stocktaking_id)::text = 'TeKarvinaKosmo07092014;87'::text)
- Filter: ((user_id)::text = ((SubPlan 24))::text)
- -> Bitmap Index Scan on idx_t_weighting_stocktaking_id_user_id (cost=0.00..312.98 rows=9141 width=0)
- Index Cond: ((stocktaking_id)::text = 'TeKarvinaKosmo07092014;87'::text)
- SubPlan 24
- -> Limit (cost=8.46..8.46 rows=1 width=16)
- -> Sort (cost=8.46..8.46 rows=1 width=16)
- Sort Key: wi.stat_item_start
- -> Index Scan using int_t_weighting_coordinates on t_weighting wi (cost=0.42..8.45 rows=1 width=16)
- Index Cond: ((coord_z = w.coord_z) AND (coord_x = w.coord_x) AND (coord_y = w.coord_y))
- Filter: ((stocktaking_id)::text = (w.stocktaking_id)::text)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item i (cost=0.43..8.45 rows=1 width=52)
- Index Cond: ((ean = w.item_ean) AND (company_fk = $33))
- SubPlan 22
- -> Limit (cost=8.72..16.74 rows=1 width=11)
- InitPlan 21 (returns $31)
- -> Index Scan using t_store_info_pkey on t_store_info s_8 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_ean on t_pn pn_1 (cost=0.43..8.45 rows=1 width=11)
- Index Cond: ((company_fk = $31) AND (i.ean = ean))
- SubPlan 17
- -> Limit (cost=8.29..8.41 rows=1 width=11)
- InitPlan 16 (returns $19)
- -> Index Scan using t_store_info_pkey on t_store_info s_7 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Nested Loop (cost=0.00..72351.91 rows=624663 width=11)
- -> Seq Scan on t_pn pn (cost=0.00..37498.65 rows=1 width=11)
- Filter: ((max(w.item_ean) = ean) AND (company_fk = $19))
- -> Seq Scan on t_weighting w4 (cost=0.00..28606.63 rows=624663 width=0)
- SubPlan 18
- -> Result (cost=0.00..0.02 rows=1 width=0)
- SubPlan 19
- -> Result (cost=0.00..0.02 rows=1 width=0)
- SubPlan 20
- -> Aggregate (cost=60.55..60.56 rows=1 width=52)
- -> HashAggregate (cost=60.45..60.47 rows=1 width=27)
- -> Index Scan using idx_t_weighting_stocktaking_id_item_ean on t_weighting w3 (cost=0.43..60.36 rows=4 width=27)
- Index Cond: (((stocktaking_id)::text = (w.stocktaking_id)::text) AND (item_ean = ANY (array_agg(w.item_ean))))
- SubPlan 5
- -> Result (cost=33.50..33.51 rows=1 width=0)
- InitPlan 4 (returns $5)
- -> Limit (cost=8.72..33.50 rows=1 width=13)
- InitPlan 3 (returns $2)
- -> Index Scan using t_store_info_pkey on t_store_info s_1 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pe (cost=0.43..25.21 rows=1 width=13)
- Index Cond: ((company_fk = $2) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
- SubPlan 2
- -> Limit (cost=16.75..16.76 rows=1 width=4)
- InitPlan 1 (returns $0)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Aggregate (cost=8.46..8.46 rows=1 width=4)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item iu (cost=0.43..8.45 rows=1 width=4)
- Index Cond: ((pe.ean = ean) AND (company_fk = $0))
- SubPlan 7
- -> Aggregate (cost=16.75..16.76 rows=1 width=13)
- InitPlan 6 (returns $6)
- -> Index Scan using t_store_info_pkey on t_store_info s_2 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pe_1 (cost=0.43..8.45 rows=1 width=13)
- Index Cond: ((company_fk = $6) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
- SubPlan 11
- -> Limit (cost=8.72..33.48 rows=1 width=13)
- InitPlan 10 (returns $11)
- -> Index Scan using t_store_info_pkey on t_store_info s_4 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pd (cost=0.43..25.19 rows=1 width=13)
- Index Cond: ((company_fk = $11) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
- SubPlan 9
- -> Limit (cost=8.72..16.74 rows=1 width=27)
- InitPlan 8 (returns $9)
- -> Index Scan using t_store_info_pkey on t_store_info s_3 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item i_1 (cost=0.43..8.45 rows=1 width=27)
- Index Cond: ((ean = pd.ean) AND (company_fk = $9))
- SubPlan 15
- -> Limit (cost=8.72..33.48 rows=1 width=13)
- InitPlan 14 (returns $16)
- -> Index Scan using t_store_info_pkey on t_store_info s_6 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pe_2 (cost=0.43..25.19 rows=1 width=13)
- Index Cond: ((company_fk = $16) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
- SubPlan 13
- -> Limit (cost=8.72..16.74 rows=1 width=8)
- InitPlan 12 (returns $14)
- -> Index Scan using t_store_info_pkey on t_store_info s_5 (cost=0.28..8.29 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item hi (cost=0.43..8.45 rows=1 width=8)
- Index Cond: ((pe_2.ean = ean) AND (company_fk = $14))
- (113 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement