Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.63 KB | None | 0 0
  1. # 5.7
  2.  
  3. {
  4. "steps": [
  5. {
  6. "join_preparation": {
  7. "select#": 1,
  8. "steps": [
  9. {
  10. "expanded_query": "/* select#1 */ select distinct `i`.`Name` AS `Name`,`d`.`id` AS `id`,`i`.`deviceType` AS `deviceType`,`i`.`issuedBy` AS `issuedBy`,`d`.`description` AS `description`,`i`.`avNum` AS `avNum`,`d`.`CompanyName` AS `CompanyName`,`d`.`BrandName` AS `BrandName`,`d`.`dwNumber` AS `dwNumber`,`i`.`quant` AS `quant`,`i`.`discDate` AS `discDate`,`i`.`Type` AS `Type` from (`table_one` `d` join `table_two` `i` on((`d`.`id` = `i`.`id`)))"
  11. },
  12. {
  13. "transformations_to_nested_joins": {
  14. "transformations": [
  15. "JOIN_condition_to_WHERE",
  16. "parenthesis_removal"
  17. ],
  18. "expanded_query": "/* select#1 */ select distinct `i`.`Name` AS `Name`,`d`.`id` AS `id`,`i`.`deviceType` AS `deviceType`,`i`.`issuedBy` AS `issuedBy`,`d`.`description` AS `description`,`i`.`avNum` AS `avNum`,`d`.`CompanyName` AS `CompanyName`,`d`.`BrandName` AS `BrandName`,`d`.`dwNumber` AS `dwNumber`,`i`.`quant` AS `quant`,`i`.`discDate` AS `discDate`,`i`.`Type` AS `Type` from `table_one` `d` join `table_two` `i` where (`d`.`id` = `i`.`id`)"
  19. }
  20. }
  21. ]
  22. }
  23. },
  24. {
  25. "join_optimization": {
  26. "select#": 1,
  27. "steps": [
  28. {
  29. "condition_processing": {
  30. "condition": "WHERE",
  31. "original_condition": "(`d`.`id` = `i`.`id`)",
  32. "steps": [
  33. {
  34. "transformation": "equality_propagation",
  35. "resulting_condition": "multiple equal(`d`.`id`, `i`.`id`)"
  36. },
  37. {
  38. "transformation": "constant_propagation",
  39. "resulting_condition": "multiple equal(`d`.`id`, `i`.`id`)"
  40. },
  41. {
  42. "transformation": "trivial_condition_removal",
  43. "resulting_condition": "multiple equal(`d`.`id`, `i`.`id`)"
  44. }
  45. ]
  46. }
  47. },
  48. {
  49. "substitute_generated_columns": {
  50. }
  51. },
  52. {
  53. "table_dependencies": [
  54. {
  55. "table": "`table_one` `d`",
  56. "row_may_be_null": false,
  57. "map_bit": 0,
  58. "depends_on_map_bits": [
  59. ]
  60. },
  61. {
  62. "table": "`table_two` `i`",
  63. "row_may_be_null": false,
  64. "map_bit": 1,
  65. "depends_on_map_bits": [
  66. ]
  67. }
  68. ]
  69. },
  70. {
  71. "ref_optimizer_key_uses": [
  72. {
  73. "table": "`table_one` `d`",
  74. "field": "id",
  75. "equals": "`i`.`id`",
  76. "null_rejecting": true
  77. },
  78. {
  79. "table": "`table_two` `i`",
  80. "field": "id",
  81. "equals": "`d`.`id`",
  82. "null_rejecting": false
  83. }
  84. ]
  85. },
  86. {
  87. "rows_estimation": [
  88. {
  89. "table": "`table_one` `d`",
  90. "table_scan": {
  91. "rows": 1753374,
  92. "cost": 41856
  93. }
  94. },
  95. {
  96. "table": "`table_two` `i`",
  97. "table_scan": {
  98. "rows": 2372742,
  99. "cost": 12976
  100. }
  101. }
  102. ]
  103. },
  104. {
  105. "considered_execution_plans": [
  106. {
  107. "plan_prefix": [
  108. ],
  109. "table": "`table_one` `d`",
  110. "best_access_path": {
  111. "considered_access_paths": [
  112. {
  113. "access_type": "ref",
  114. "index": "PRIMARY",
  115. "usable": false,
  116. "chosen": false
  117. },
  118. {
  119. "rows_to_scan": 1753374,
  120. "access_type": "scan",
  121. "resulting_rows": 1.75e6,
  122. "cost": 392531,
  123. "chosen": true
  124. }
  125. ]
  126. },
  127. "condition_filtering_pct": 100,
  128. "rows_for_plan": 1.75e6,
  129. "cost_for_plan": 392531,
  130. "rest_of_plan": [
  131. {
  132. "plan_prefix": [
  133. "`table_one` `d`"
  134. ],
  135. "table": "`table_two` `i`",
  136. "best_access_path": {
  137. "considered_access_paths": [
  138. {
  139. "access_type": "ref",
  140. "index": "idx_table_two_id",
  141. "rows": 1.3879,
  142. "cost": 2.92e6,
  143. "chosen": true
  144. },
  145. {
  146. "rows_to_scan": 2372742,
  147. "access_type": "scan",
  148. "using_join_cache": true,
  149. "buffers_needed": 26166,
  150. "resulting_rows": 2.37e6,
  151. "cost": 8.3e11,
  152. "chosen": false
  153. }
  154. ]
  155. },
  156. "condition_filtering_pct": 100,
  157. "rows_for_plan": 2.43e6,
  158. "cost_for_plan": 3.31e6,
  159. "chosen": true
  160. }
  161. ]
  162. },
  163. {
  164. "plan_prefix": [
  165. ],
  166. "table": "`table_two` `i`",
  167. "best_access_path": {
  168. "considered_access_paths": [
  169. {
  170. "access_type": "ref",
  171. "index": "idx_table_two_id",
  172. "usable": false,
  173. "chosen": false
  174. },
  175. {
  176. "rows_to_scan": 2372742,
  177. "access_type": "scan",
  178. "resulting_rows": 2.37e6,
  179. "cost": 487524,
  180. "chosen": true
  181. }
  182. ]
  183. },
  184. "condition_filtering_pct": 100,
  185. "rows_for_plan": 2.37e6,
  186. "cost_for_plan": 487524,
  187. "rest_of_plan": [
  188. {
  189. "plan_prefix": [
  190. "`table_two` `i`"
  191. ],
  192. "table": "`table_one` `d`",
  193. "best_access_path": {
  194. "considered_access_paths": [
  195. {
  196. "access_type": "eq_ref",
  197. "index": "PRIMARY",
  198. "rows": 1,
  199. "cost": 2.85e6,
  200. "chosen": true,
  201. "cause": "clustered_pk_chosen_by_heuristics"
  202. },
  203. {
  204. "rows_to_scan": 1753374,
  205. "access_type": "scan",
  206. "using_join_cache": true,
  207. "buffers_needed": 7785,
  208. "resulting_rows": 1.75e6,
  209. "cost": 8.3e11,
  210. "chosen": false
  211. }
  212. ]
  213. },
  214. "condition_filtering_pct": 100,
  215. "rows_for_plan": 2.37e6,
  216. "cost_for_plan": 3.33e6,
  217. "pruned_by_cost": true
  218. }
  219. ]
  220. }
  221. ]
  222. },
  223. {
  224. "attaching_conditions_to_tables": {
  225. "original_condition": "(`i`.`id` = `d`.`id`)",
  226. "attached_conditions_computation": [
  227. ],
  228. "attached_conditions_summary": [
  229. {
  230. "table": "`table_one` `d`",
  231. "attached": null
  232. },
  233. {
  234. "table": "`table_two` `i`",
  235. "attached": null
  236. }
  237. ]
  238. }
  239. },
  240. {
  241. "refine_plan": [
  242. {
  243. "table": "`table_one` `d`"
  244. },
  245. {
  246. "table": "`table_two` `i`"
  247. }
  248. ]
  249. }
  250. ]
  251. }
  252. },
  253. {
  254. "join_execution": {
  255. "select#": 1,
  256. "steps": [
  257. {
  258. "creating_tmp_table": {
  259. "tmp_table_info": {
  260. "table": "intermediate_tmp_table",
  261. "row_length": 4575,
  262. "key_length": 8,
  263. "unique_constraint": true,
  264. "location": "memory (heap)",
  265. "row_limit_estimate": 3667
  266. }
  267. }
  268. },
  269. {
  270. "converting_tmp_table_to_ondisk": {
  271. "cause": "memory_table_size_exceeded",
  272. "tmp_table_info": {
  273. "table": "intermediate_tmp_table",
  274. "row_length": 4575,
  275. "key_length": 8,
  276. "unique_constraint": true,
  277. "location": "disk (InnoDB)",
  278. "record_format": "packed"
  279. }
  280. }
  281. }
  282. ]
  283. }
  284. }
  285. ]
  286. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement