Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUERY PLAN
- -----------------------------------------------------------------------------------------------------------------------------------------------------
- Merge Full Join (cost=118144.39..286409.41 rows=1425 width=272)
- Merge Cond: (((SubPlan 17)) = cld.product_custom_identificator)
- Filter: ((COALESCE((sum(cld.count)), 0::real) <> 0::double precision) OR (COALESCE(((SubPlan 18)), 0::numeric) <> 0::numeric))
- -> Sort (cost=94186.39..94186.42 rows=10 width=129)
- Sort Key: ((SubPlan 17))
- InitPlan 23 (returns $33)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> GroupAggregate (cost=93334.74..94177.96 rows=10 width=129)
- -> Sort (cost=93334.74..93334.76 rows=10 width=129)
- Sort Key: w.stocktaking_id, ((SubPlan 22))
- -> Nested Loop (cost=331.60..93334.57 rows=10 width=129)
- -> Bitmap Heap Scan on t_weighting w (cost=331.60..92778.13 rows=45 width=97)
- 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..331.59 rows=8954 width=0)
- Index Cond: ((stocktaking_id)::text = 'TeKarvinaKosmo07092014;87'::text)
- SubPlan 24
- -> Limit (cost=8.42..8.42 rows=1 width=16)
- -> Sort (cost=8.42..8.42 rows=1 width=16)
- Sort Key: wi.stat_item_start
- -> Index Scan using int_t_weighting_coordinates on t_weighting wi (cost=0.00..8.41 rows=1 width=16)
- Index Cond: ((coord_z = $36) AND (coord_x = $34) AND (coord_y = $35))
- Filter: ((stocktaking_id)::text = ($37)::text)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item i (cost=0.00..8.60 rows=1 width=52)
- Index Cond: ((i.ean = w.item_ean) AND (i.company_fk = $33))
- SubPlan 22
- -> Limit (cost=8.27..16.90 rows=1 width=11)
- InitPlan 21 (returns $31)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_ean on t_pn pn (cost=0.00..8.64 rows=1 width=11)
- Index Cond: ((company_fk = $31) AND ($32 = ean))
- SubPlan 17
- -> Limit (cost=8.27..8.32 rows=1 width=11)
- InitPlan 16 (returns $19)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Nested Loop (cost=0.00..34861.90 rows=624663 width=11)
- -> Index Scan using inx_pn_companyfk_ean on t_pn pn (cost=0.00..8.64 rows=1 width=11)
- Index Cond: ((company_fk = $19) AND ($20 = ean))
- -> 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=58.90..58.97 rows=1 width=52)
- -> HashAggregate (cost=58.86..58.89 rows=1 width=27)
- -> Bitmap Heap Scan on t_weighting w3 (cost=42.83..58.77 rows=4 width=27)
- Recheck Cond: (((stocktaking_id)::text = ($30)::text) AND (item_ean = ANY ($29)))
- -> Bitmap Index Scan on idx_t_weighting_stocktaking_id_item_ean (cost=0.00..42.82 rows=4 width=0)
- Index Cond: (((stocktaking_id)::text = ($30)::text) AND (item_ean = ANY ($29)))
- -> Sort (cost=23958.00..23961.57 rows=1426 width=40)
- Sort Key: cld.product_custom_identificator
- -> HashAggregate (cost=23847.65..23869.04 rows=1426 width=15)
- InitPlan 25 (returns $38)
- -> Index Scan using uniq_t_currentlevel_stocktakingid_storeid on t_currentlevel cl (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (stocktaking_id = 'TeKarvinaKosmo07092014;87'::text)
- -> Bitmap Heap Scan on t_currentlevel_data cld (cost=1030.09..23551.68 rows=38360 width=15)
- Recheck Cond: (batch_id = $38)
- -> Bitmap Index Scan on ind_currentleveldata_batchid_pci (cost=0.00..1020.50 rows=38360 width=0)
- Index Cond: (batch_id = $38)
- SubPlan 5
- -> Result (cost=33.74..33.75 rows=1 width=0)
- InitPlan 4 (returns $5)
- -> Limit (cost=8.27..33.74 rows=1 width=13)
- InitPlan 3 (returns $2)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pe (cost=0.00..25.47 rows=1 width=13)
- Index Cond: ((company_fk = $2) AND (product_custom_identificator = COALESCE($3, $4)))
- SubPlan 2
- -> Limit (cost=16.87..16.88 rows=1 width=4)
- InitPlan 1 (returns $0)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Aggregate (cost=8.60..8.61 rows=1 width=4)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item iu (cost=0.00..8.59 rows=1 width=4)
- Index Cond: (($1 = ean) AND (company_fk = $0))
- SubPlan 7
- -> Aggregate (cost=16.86..16.87 rows=1 width=13)
- InitPlan 6 (returns $6)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pe (cost=0.00..8.59 rows=1 width=13)
- Index Cond: ((company_fk = $6) AND (product_custom_identificator = COALESCE($7, $8)))
- SubPlan 11
- -> Limit (cost=8.27..33.72 rows=1 width=13)
- InitPlan 10 (returns $11)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pd (cost=0.00..25.45 rows=1 width=13)
- Index Cond: ((company_fk = $11) AND (product_custom_identificator = COALESCE($12, $13)))
- SubPlan 9
- -> Limit (cost=8.27..16.86 rows=1 width=27)
- InitPlan 8 (returns $9)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item i (cost=0.00..8.59 rows=1 width=27)
- Index Cond: ((ean = $10) AND (company_fk = $9))
- SubPlan 15
- -> Limit (cost=8.27..33.72 rows=1 width=13)
- InitPlan 14 (returns $16)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using inx_pn_companyfk_pci on t_pn pe (cost=0.00..25.45 rows=1 width=13)
- Index Cond: ((company_fk = $16) AND (product_custom_identificator = COALESCE($17, $18)))
- SubPlan 13
- -> Limit (cost=8.27..16.86 rows=1 width=8)
- InitPlan 12 (returns $14)
- -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.00..8.27 rows=1 width=8)
- Index Cond: (id = 87::bigint)
- -> Index Scan using t_item_ean_company_fk_uniq on t_item hi (cost=0.00..8.59 rows=1 width=8)
- Index Cond: (($15 = ean) AND (company_fk = $14))
- (115 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement