Advertisement
Guest User

Untitled

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