Advertisement
Guest User

Untitled

a guest
Sep 26th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.80 KB | None | 0 0
  1. QUERY PLAN
  2. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  3. Hash Full Join (cost=120086.28..288158.58 rows=1433 width=247) (actual time=4793.409..4918.029 rows=5919 loops=1)
  4. Hash Cond: (cld.product_custom_identificator = collected.pci)
  5. Filter: ((COALESCE((sum(cld.count)), 0::real) <> 0::double precision) OR (COALESCE(collected.total, 0::numeric) <> 0::numeric))
  6. Rows Removed by Filter: 2
  7. -> HashAggregate (cost=23731.30..23745.64 rows=1434 width=15) (actual time=10.342..15.889 rows=5664 loops=1)
  8. InitPlan 25 (returns $39)
  9. -> Index Scan using uniq_t_currentlevel_stocktakingid_storeid on t_currentlevel cl (cost=0.27..8.29 rows=1 width=8) (actual time=0.054..0.055 rows=1 loops=1)
  10. Index Cond: (stocktaking_id = 'TeKarvinaKosmo07092014;87'::text)
  11. -> Bitmap Heap Scan on t_currentlevel_data cld (cost=913.72..23435.31 rows=38360 width=15) (actual time=0.937..3.907 rows=5664 loops=1)
  12. Recheck Cond: (batch_id = $39)
  13. -> Bitmap Index Scan on ind_currentleveldata_batchid_pci (cost=0.00..904.13 rows=38360 width=0) (actual time=0.919..0.919 rows=5664 loops=1)
  14. Index Cond: (batch_id = $39)
  15. -> Hash (cost=96354.86..96354.86 rows=10 width=232) (actual time=4783.010..4783.010 rows=5618 loops=1)
  16. Buckets: 1024 Batches: 1 Memory Usage: 811kB
  17. -> Subquery Scan on collected (cost=96354.73..96354.86 rows=10 width=232) (actual time=4770.172..4777.599 rows=5618 loops=1)
  18. -> Sort (cost=96354.73..96354.76 rows=10 width=129) (actual time=4770.168..4772.310 rows=5618 loops=1)
  19. Sort Key: ((SubPlan 17))
  20. Sort Method: quicksort Memory: 1690kB
  21. InitPlan 23 (returns $33)
  22. -> Index Scan using t_store_info_pkey on t_store_info s_9 (cost=0.28..8.29 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=1)
  23. Index Cond: (id = 87::bigint)
  24. -> GroupAggregate (cost=95479.18..96346.27 rows=10 width=129) (actual time=2328.774..4757.026 rows=5618 loops=1)
  25. -> Sort (cost=95479.18..95479.20 rows=10 width=129) (actual time=2328.346..2335.394 rows=9246 loops=1)
  26. Sort Key: w.stocktaking_id, ((SubPlan 22))
  27. Sort Method: quicksort Memory: 2576kB
  28. -> Nested Loop (cost=313.42..95479.01 rows=10 width=129) (actual time=3.151..1814.618 rows=9246 loops=1)
  29. -> Bitmap Heap Scan on t_weighting w (cost=312.99..94922.43 rows=46 width=77) (actual time=3.074..1387.025 rows=9246 loops=1)
  30. Recheck Cond: ((stocktaking_id)::text = 'TeKarvinaKosmo07092014;87'::text)
  31. Filter: ((user_id)::text = ((SubPlan 24))::text)
  32. -> Bitmap Index Scan on idx_t_weighting_stocktaking_id_user_id (cost=0.00..312.98 rows=9141 width=0) (actual time=2.566..2.566 rows=9246 loops=1)
  33. Index Cond: ((stocktaking_id)::text = 'TeKarvinaKosmo07092014;87'::text)
  34. SubPlan 24
  35. -> Limit (cost=8.46..8.46 rows=1 width=16) (actual time=0.145..0.146 rows=1 loops=9246)
  36. -> Sort (cost=8.46..8.46 rows=1 width=16) (actual time=0.144..0.144 rows=1 loops=9246)
  37. Sort Key: wi.stat_item_start
  38. Sort Method: top-N heapsort Memory: 25kB
  39. -> Index Scan using int_t_weighting_coordinates on t_weighting wi (cost=0.42..8.45 rows=1 width=16) (actual time=0.025..0.104 rows=46 loops=9246)
  40. Index Cond: ((coord_z = w.coord_z) AND (coord_x = w.coord_x) AND (coord_y = w.coord_y))
  41. Filter: ((stocktaking_id)::text = (w.stocktaking_id)::text)
  42. Rows Removed by Filter: 34
  43. -> Index Scan using t_item_ean_company_fk_uniq on t_item i (cost=0.43..8.45 rows=1 width=52) (actual time=0.019..0.020 rows=1 loops=9246)
  44. Index Cond: ((ean = w.item_ean) AND (company_fk = $33))
  45. SubPlan 22
  46. -> Limit (cost=8.72..16.74 rows=1 width=11) (actual time=0.020..0.020 rows=1 loops=9246)
  47. InitPlan 21 (returns $31)
  48. -> Index Scan using t_store_info_pkey on t_store_info s_8 (cost=0.28..8.29 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=1)
  49. Index Cond: (id = 87::bigint)
  50. -> Index Scan using inx_pn_companyfk_ean on t_pn pn_1 (cost=0.43..8.45 rows=1 width=11) (actual time=0.018..0.018 rows=1 loops=9246)
  51. Index Cond: ((company_fk = $31) AND (i.ean = ean))
  52. SubPlan 17
  53. -> Limit (cost=9.15..9.31 rows=1 width=11) (actual time=0.278..0.278 rows=1 loops=5618)
  54. InitPlan 16 (returns $19)
  55. -> Index Scan using t_store_info_pkey on t_store_info s_7 (cost=0.28..8.29 rows=1 width=8) (actual time=0.013..0.014 rows=1 loops=1)
  56. Index Cond: (id = 87::bigint)
  57. -> Nested Loop (cost=0.85..102881.78 rows=624667 width=11) (actual time=0.276..0.276 rows=1 loops=5618)
  58. -> Index Only Scan using int_t_weighting_coordinates on t_weighting w4 (cost=0.42..95064.99 rows=624667 width=0) (actual time=0.013..0.122 rows=112 loops=5618)
  59. Heap Fetches: 630284
  60. -> Materialize (cost=0.43..8.45 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=630284)
  61. -> Index Scan using inx_pn_companyfk_ean on t_pn pn (cost=0.43..8.45 rows=1 width=11) (actual time=0.020..0.020 rows=1 loops=5618)
  62. Index Cond: ((company_fk = $19) AND (max(w.item_ean) = ean))
  63. SubPlan 18
  64. -> Result (cost=0.00..0.02 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=5618)
  65. SubPlan 19
  66. -> Result (cost=0.00..0.02 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=9246)
  67. SubPlan 20
  68. -> Aggregate (cost=60.55..60.56 rows=1 width=52) (actual time=0.105..0.105 rows=1 loops=5618)
  69. -> HashAggregate (cost=60.45..60.47 rows=1 width=27) (actual time=0.091..0.092 rows=1 loops=5618)
  70. -> Index Scan using idx_t_weighting_stocktaking_id_item_ean on t_weighting w3 (cost=0.43..60.36 rows=4 width=27) (actual time=0.073..0.077 rows=2 loops=5618)
  71. Index Cond: (((stocktaking_id)::text = (w.stocktaking_id)::text) AND (item_ean = ANY (array_agg(w.item_ean))))
  72. SubPlan 5
  73. -> Result (cost=33.50..33.51 rows=1 width=0) (actual time=0.075..0.076 rows=1 loops=303)
  74. InitPlan 4 (returns $5)
  75. -> Limit (cost=8.72..33.50 rows=1 width=13) (actual time=0.072..0.073 rows=1 loops=303)
  76. InitPlan 3 (returns $2)
  77. -> Index Scan using t_store_info_pkey on t_store_info s_1 (cost=0.28..8.29 rows=1 width=8) (actual time=0.017..0.018 rows=1 loops=1)
  78. Index Cond: (id = 87::bigint)
  79. -> Index Scan using inx_pn_companyfk_pci on t_pn pe (cost=0.43..25.21 rows=1 width=13) (actual time=0.070..0.070 rows=1 loops=303)
  80. Index Cond: ((company_fk = $2) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
  81. SubPlan 2
  82. -> Limit (cost=16.75..16.76 rows=1 width=4) (actual time=0.039..0.040 rows=1 loops=303)
  83. InitPlan 1 (returns $0)
  84. -> Index Scan using t_store_info_pkey on t_store_info s (cost=0.28..8.29 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=1)
  85. Index Cond: (id = 87::bigint)
  86. -> Aggregate (cost=8.46..8.46 rows=1 width=4) (actual time=0.037..0.037 rows=1 loops=303)
  87. -> Index Scan using t_item_ean_company_fk_uniq on t_item iu (cost=0.43..8.45 rows=1 width=4) (actual time=0.023..0.025 rows=1 loops=303)
  88. Index Cond: ((pe.ean = ean) AND (company_fk = $0))
  89. SubPlan 7
  90. -> Aggregate (cost=16.75..16.76 rows=1 width=13) (actual time=0.037..0.037 rows=1 loops=303)
  91. InitPlan 6 (returns $6)
  92. -> Index Scan using t_store_info_pkey on t_store_info s_2 (cost=0.28..8.29 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=1)
  93. Index Cond: (id = 87::bigint)
  94. -> Index Scan using inx_pn_companyfk_pci on t_pn pe_1 (cost=0.43..8.45 rows=1 width=13) (actual time=0.023..0.029 rows=4 loops=303)
  95. Index Cond: ((company_fk = $6) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
  96. SubPlan 11
  97. -> Limit (cost=8.72..33.48 rows=1 width=13) (actual time=0.048..0.048 rows=1 loops=303)
  98. InitPlan 10 (returns $11)
  99. -> Index Scan using t_store_info_pkey on t_store_info s_4 (cost=0.28..8.29 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)
  100. Index Cond: (id = 87::bigint)
  101. -> Index Scan using inx_pn_companyfk_pci on t_pn pd (cost=0.43..25.19 rows=1 width=13) (actual time=0.046..0.046 rows=1 loops=303)
  102. Index Cond: ((company_fk = $11) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
  103. SubPlan 9
  104. -> Limit (cost=8.72..16.74 rows=1 width=27) (actual time=0.022..0.022 rows=1 loops=303)
  105. InitPlan 8 (returns $9)
  106. -> Index Scan using t_store_info_pkey on t_store_info s_3 (cost=0.28..8.29 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=1)
  107. Index Cond: (id = 87::bigint)
  108. -> Index Scan using t_item_ean_company_fk_uniq on t_item i_1 (cost=0.43..8.45 rows=1 width=27) (actual time=0.020..0.020 rows=1 loops=303)
  109. Index Cond: ((ean = pd.ean) AND (company_fk = $9))
  110. SubPlan 15
  111. -> Limit (cost=8.72..33.48 rows=1 width=13) (actual time=0.050..0.050 rows=1 loops=305)
  112. InitPlan 14 (returns $16)
  113. -> Index Scan using t_store_info_pkey on t_store_info s_6 (cost=0.28..8.29 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=1)
  114. Index Cond: (id = 87::bigint)
  115. -> Index Scan using inx_pn_companyfk_pci on t_pn pe_2 (cost=0.43..25.19 rows=1 width=13) (actual time=0.047..0.047 rows=1 loops=305)
  116. Index Cond: ((company_fk = $16) AND (product_custom_identificator = COALESCE(cld.product_custom_identificator, collected.pci)))
  117. SubPlan 13
  118. -> Limit (cost=8.72..16.74 rows=1 width=8) (actual time=0.022..0.022 rows=1 loops=304)
  119. InitPlan 12 (returns $14)
  120. -> Index Scan using t_store_info_pkey on t_store_info s_5 (cost=0.28..8.29 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=1)
  121. Index Cond: (id = 87::bigint)
  122. -> Index Scan using t_item_ean_company_fk_uniq on t_item hi (cost=0.43..8.45 rows=1 width=8) (actual time=0.020..0.020 rows=1 loops=304)
  123. Index Cond: ((pe_2.ean = ean) AND (company_fk = $14))
  124. Total runtime: 4921.560 ms
  125. (122 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement