Advertisement
dkasak

mysql optimizer: v2_things

Mar 19th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 8.43 KB | None | 0 0
  1. {
  2.   "steps": [
  3.     {
  4.       "join_preparation": {
  5.         "select#": 1,
  6.         "steps": [
  7.           {
  8.             "expanded_query": "/* select#1 */ select `v2_thing`.`id` AS `ID` from `v2_thing` where ((`v2_thing`.`demo` = 'N') and (`v2_thing`.`created_datetime` > (now() - interval 50 day)) and (`v2_thing`.`status` = 'C'))"
  9.           }
  10.         ]
  11.       }
  12.     },
  13.     {
  14.       "join_optimization": {
  15.         "select#": 1,
  16.         "steps": [
  17.           {
  18.             "condition_processing": {
  19.               "condition": "WHERE",
  20.               "original_condition": "((`v2_thing`.`demo` = 'N') and (`v2_thing`.`created_datetime` > (now() - interval 50 day)) and (`v2_thing`.`status` = 'C'))",
  21.               "steps": [
  22.                 {
  23.                   "transformation": "equality_propagation",
  24.                   "resulting_condition": "((`v2_thing`.`demo` = 'N') and (`v2_thing`.`created_datetime` > (now() - interval 50 day)) and (`v2_thing`.`status` = 'C'))"
  25.                 },
  26.                 {
  27.                   "transformation": "constant_propagation",
  28.                   "resulting_condition": "((`v2_thing`.`demo` = 'N') and (`v2_thing`.`created_datetime` > (now() - interval 50 day)) and (`v2_thing`.`status` = 'C'))"
  29.                 },
  30.                 {
  31.                   "transformation": "trivial_condition_removal",
  32.                   "resulting_condition": "((`v2_thing`.`demo` = 'N') and (`v2_thing`.`created_datetime` > (now() - interval 50 day)) and (`v2_thing`.`status` = 'C'))"
  33.                 }
  34.               ]
  35.             }
  36.           },
  37.           {
  38.             "substitute_generated_columns": {
  39.             }
  40.           },
  41.           {
  42.             "table_dependencies": [
  43.               {
  44.                 "table": "`v2_thing`",
  45.                 "row_may_be_null": false,
  46.                 "map_bit": 0,
  47.                 "depends_on_map_bits": [
  48.                 ]
  49.               }
  50.             ]
  51.           },
  52.           {
  53.             "ref_optimizer_key_uses": [
  54.               {
  55.                 "table": "`v2_thing`",
  56.                 "field": "status",
  57.                 "equals": "'C'",
  58.                 "null_rejecting": false
  59.               }
  60.             ]
  61.           },
  62.           {
  63.             "rows_estimation": [
  64.               {
  65.                 "table": "`v2_thing`",
  66.                 "range_analysis": {
  67.                   "table_scan": {
  68.                     "rows": 79054472,
  69.                     "cost": 1.69e7
  70.                   },
  71.                   "potential_range_indexes": [
  72.                     {
  73.                       "index": "PRIMARY",
  74.                       "usable": false,
  75.                       "cause": "not_applicable"
  76.                     },
  77.                     {
  78.                       "index": "idx_status_thing",
  79.                       "usable": true,
  80.                       "key_parts": [
  81.                         "status",
  82.                         "id"
  83.                       ]
  84.                     },
  85.                     {
  86.                       "index": "idx_created_datetime_thing",
  87.                       "usable": true,
  88.                       "key_parts": [
  89.                         "created_datetime",
  90.                         "id"
  91.                       ]
  92.                     },
  93.                     {
  94.                       "index": "idx_clientid_thing",
  95.                       "usable": false,
  96.                       "cause": "not_applicable"
  97.                     },
  98.                     {
  99.                       "index": "idx_external_reference_thing",
  100.                       "usable": false,
  101.                       "cause": "not_applicable"
  102.                     },
  103.                     {
  104.                       "index": "idx_person_contact_type_thing",
  105.                       "usable": false,
  106.                       "cause": "not_applicable"
  107.                     },
  108.                     {
  109.                       "index": "fk_buyer_thing",
  110.                       "usable": false,
  111.                       "cause": "not_applicable"
  112.                     },
  113.                     {
  114.                       "index": "v2_thing_owner_user_id_index",
  115.                       "usable": false,
  116.                       "cause": "not_applicable"
  117.                     }
  118.                   ],
  119.                   "setup_range_conditions": [
  120.                   ],
  121.                   "group_index_range": {
  122.                     "chosen": false,
  123.                     "cause": "not_group_by_or_distinct"
  124.                   },
  125.                   "analyzing_range_alternatives": {
  126.                     "range_scan_alternatives": [
  127.                       {
  128.                         "index": "idx_status_thing",
  129.                         "ranges": [
  130.                           "C <= status <= C"
  131.                         ],
  132.                         "index_dives_for_eq_ranges": true,
  133.                         "rowid_ordered": true,
  134.                         "using_mrr": false,
  135.                         "index_only": false,
  136.                         "rows": 39527236,
  137.                         "cost": 4.74e7,
  138.                         "chosen": false,
  139.                         "cause": "cost"
  140.                       },
  141.                       {
  142.                         "index": "idx_created_datetime_thing",
  143.                         "ranges": [
  144.                           "0x999ef970bb < created_datetime"
  145.                         ],
  146.                         "index_dives_for_eq_ranges": true,
  147.                         "rowid_ordered": false,
  148.                         "using_mrr": false,
  149.                         "index_only": false,
  150.                         "rows": 10072076,
  151.                         "cost": 1.21e7,
  152.                         "chosen": true
  153.                       }
  154.                     ],
  155.                     "analyzing_roworder_intersect": {
  156.                       "usable": false,
  157.                       "cause": "too_few_roworder_scans"
  158.                     }
  159.                   },
  160.                   "chosen_range_access_summary": {
  161.                     "range_access_plan": {
  162.                       "type": "range_scan",
  163.                       "index": "idx_created_datetime_thing",
  164.                       "rows": 10072076,
  165.                       "ranges": [
  166.                         "0x999ef970bb < created_datetime"
  167.                       ]
  168.                     },
  169.                     "rows_for_plan": 10072076,
  170.                     "cost_for_plan": 1.21e7,
  171.                     "chosen": true
  172.                   }
  173.                 }
  174.               }
  175.             ]
  176.           },
  177.           {
  178.             "considered_execution_plans": [
  179.               {
  180.                 "plan_prefix": [
  181.                 ],
  182.                 "table": "`v2_thing`",
  183.                 "best_access_path": {
  184.                   "considered_access_paths": [
  185.                     {
  186.                       "access_type": "ref",
  187.                       "index": "idx_status_thing",
  188.                       "rows": 3.95e7,
  189.                       "cost": 1.11e7,
  190.                       "chosen": true
  191.                     },
  192.                     {
  193.                       "rows_to_scan": 10072076,
  194.                       "access_type": "range",
  195.                       "range_details": {
  196.                         "used_index": "idx_created_datetime_thing"
  197.                       },
  198.                       "resulting_rows": 503604,
  199.                       "cost": 1.41e7,
  200.                       "chosen": false
  201.                     }
  202.                   ]
  203.                 },
  204.                 "condition_filtering_pct": 1.2741,
  205.                 "rows_for_plan": 503604,
  206.                 "cost_for_plan": 1.11e7,
  207.                 "chosen": true
  208.               }
  209.             ]
  210.           },
  211.           {
  212.             "attaching_conditions_to_tables": {
  213.               "original_condition": "((`v2_thing`.`demo` = 'N') and (`v2_thing`.`created_datetime` > (now() - interval 50 day)) and (`v2_thing`.`status` = 'C'))",
  214.               "attached_conditions_computation": [
  215.               ],
  216.               "attached_conditions_summary": [
  217.                 {
  218.                   "table": "`v2_thing`",
  219.                   "attached": "((`v2_thing`.`demo` = 'N') and (`v2_thing`.`created_datetime` > (now() - interval 50 day)))"
  220.                 }
  221.               ]
  222.             }
  223.           },
  224.           {
  225.             "refine_plan": [
  226.               {
  227.                 "table": "`v2_thing`"
  228.               }
  229.             ]
  230.           }
  231.         ]
  232.       }
  233.     },
  234.     {
  235.       "join_explain": {
  236.         "select#": 1,
  237.         "steps": [
  238.         ]
  239.       }
  240.     }
  241.   ]
  242. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement