mysql> SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE\G *************************** 1. row *************************** QUERY: EXPLAIN UPDATE users, (SELECT 1) dummy SET primary_password = CONCAT('test', 'explain', password) WHERE primary_password IS NULL AND password != '' AND salt IS NOT NULL TRACE: { "steps": [ { "join_preparation": { "select#": 2, "steps": [ { "expanded_query": "/* select#2 */ select 1 AS `1`" } ] } }, { "join_preparation": { "select#": 1, "steps": [ { "expanded_query": "/* select#1 */ select `users`.`primary_password` AS `primary_password` from `users` join (/* select#2 */ select 1 AS `1`) `dummy` where (isnull(`users`.`primary_password`) and (`users`.`password` <> '') and (`users`.`salt` is not null))" } ] } }, { "join_optimization": { "select#": 1, "steps": [ { "join_optimization": { "select#": 2, "steps": [ ] } }, { "creating_tmp_table": { "tmp_table_info": { "table": " `dummy`", "row_length": 5, "key_length": 0, "unique_constraint": false, "location": "memory (heap)", "row_limit_estimate": 13421772 } } }, { "join_execution": { "select#": 2, "steps": [ ] } }, { "condition_processing": { "condition": "WHERE", "original_condition": "(isnull(`users`.`primary_password`) and (`users`.`password` <> '') and (`users`.`salt` is not null))", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "(isnull(`users`.`primary_password`) and (`users`.`password` <> '') and (`users`.`salt` is not null))" }, { "transformation": "constant_propagation", "resulting_condition": "(isnull(`users`.`primary_password`) and (`users`.`password` <> '') and (`users`.`salt` is not null))" }, { "transformation": "trivial_condition_removal", "resulting_condition": "(isnull(`users`.`primary_password`) and (`users`.`password` <> '') and (`users`.`salt` is not null))" } ] } }, { "table_dependencies": [ { "table": "`users`", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [ ] }, { "table": " `dummy`", "row_may_be_null": false, "map_bit": 1, "depends_on_map_bits": [ ] } ] }, { "ref_optimizer_key_uses": [ { "table": "`users`", "field": "primary_password", "equals": "NULL", "null_rejecting": false } ] }, { "rows_estimation": [ { "table": "`users`", "range_analysis": { "table_scan": { "rows": 92274, "cost": 20976 }, "potential_range_indices": [ { "index": "PRIMARY", "usable": false, "cause": "not_applicable" }, { "index": "uniq_email", "usable": false, "cause": "not_applicable" }, { "index": "uniq_userName", "usable": false, "cause": "not_applicable" }, { "index": "guid", "usable": false, "cause": "not_applicable" }, { "index": "password", "usable": true, "key_parts": [ "password", "salt", "primary_password", "ID" ] }, { "index": "primary_password", "usable": true, "key_parts": [ "primary_password", "salt", "password", "ID" ] } ], "setup_range_conditions": [ ], "group_index_range": { "chosen": false, "cause": "not_single_table" }, "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "password", "ranges": [ "password < ", " < password" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 46138, "cost": 55368, "chosen": false, "cause": "cost" }, { "index": "primary_password", "ranges": [ "NULL <= primary_password <= NULL AND NULL < salt" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 38198, "cost": 45839, "chosen": false, "cause": "cost" } ], "analyzing_roworder_intersect": { "usable": false, "cause": "too_few_roworder_scans" } } } }, { "table": " `dummy`", "rows": 1, "cost": 1, "table_type": "system", "empty": false } ] }, { "considered_execution_plans": [ { "plan_prefix": [ " `dummy`" ], "table": "`users`", "best_access_path": { "considered_access_paths": [ { "access_type": "ref", "index": "primary_password", "rows": 38198, "cost": 15197, "chosen": true }, { "access_type": "scan", "rows": 38198, "cost": 20974, "chosen": false } ] }, "cost_for_plan": 15197, "rows_for_plan": 38198, "chosen": true } ] }, { "creating_tmp_table": { "tmp_table_info": { "table": "intermediate_tmp_table", "row_length": 106, "key_length": 4, "unique_constraint": false, "location": "memory (heap)", "row_limit_estimate": 633102 } } }, { "attaching_conditions_to_tables": { "original_condition": "(isnull(`users`.`primary_password`) and (`users`.`password` <> '') and (`users`.`salt` is not null))", "attached_conditions_computation": [ ], "attached_conditions_summary": [ { "table": "`users`", "attached": "(isnull(`users`.`primary_password`) and (`users`.`password` <> '') and (`users`.`salt` is not null))" } ] } }, { "refine_plan": [ { "table": "`users`" } ] } ] } }, { "join_explain": { "select#": 1, "steps": [ { "join_explain": { "select#": 2, "steps": [ ] } } ] } } ] } MISSING_BYTES_BEYOND_MAX_MEM_SIZE: 0 INSUFFICIENT_PRIVILEGES: 0 1 row in set (0.00 sec)