23 rows in set (22.41 sec) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+-------------------------+ | QUERY | TRACE | MISSING_BYTES_BEYOND_MAX_MEM_SIZE | INSUFFICIENT_PRIVILEGES | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+-------------------------+ | SELECT DISTINCT T2.tid, T1.data, T2.data, T1.ordrenr, T1.nr, T4.data, T3.data, T1.ordretype, T5.aendret, T5.info FROM `ordrer` AS T1 INNER JOIN `ordrer` AS T2 ON T1.ordrenr = T2.ordrenr AND T1.ordretype = T2.ordretype AND T2.datanavn = 'emnefelt' AND T2.data LIKE '%%%' LEFT JOIN `ordrer` AS T3 ON T1.ordrenr = T3.ordrenr AND T1.ordretype = T3.ordretype AND ( T3.datanavn LIKE 'domaene%' OR ( T3.datanavn = 'varenavn' AND T3.data = 'SMS' ) ) LEFT JOIN `ordrer` AS T4 ON T1.ordrenr = T4.ordrenr AND T4.datanavn = 'pris' LEFT JOIN jthnet.`sag` AS T5 ON T5.id = ( SELECT MAX( id ) FROM jthnet.`sag` WHERE T3.data = navn AND T3.nr = nr ) WHERE T1.datanavn = 'status' AND T1.ordretype = 'F' AND ( ( T2.tid >= '2008-04-20 00:00:00' AND T2.tid <= '2008-04-20 23:59:59' AND T1.data LIKE '%' ) OR ( T1.data LIKE 'ny.authent%' ) ) ORDER BY T2.tid LIMIT 5000 | { "steps": [ { "join_preparation": { "select#": 1, "steps": [ { "join_preparation": { "select#": 2, "steps": [ { "expanded_query": "/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`))" } ] } }, { "expanded_query": "/* select#1 */ select distinct `T2`.`tid` AS `tid`,`T1`.`data` AS `data`,`T2`.`data` AS `data`,`T1`.`ordrenr` AS `ordrenr`,`T1`.`nr` AS `nr`,`T4`.`data` AS `data`,`T3`.`data` AS `data`,`T1`.`ordretype` AS `ordretype`,`T5`.`aendret` AS `aendret`,`T5`.`info` AS `info` from ((((`ordrer` `T1` join `ordrer` `T2` on(((`T1`.`ordrenr` = `T2`.`ordrenr`) and (`T1`.`ordretype` = `T2`.`ordretype`) and (`T2`.`datanavn` = 'emnefelt') and (`T2`.`data` like '%%%')))) left join `ordrer` `T3` on(((`T1`.`ordrenr` = `T3`.`ordrenr`) and (`T1`.`ordretype` = `T3`.`ordretype`) and ((`T3`.`datanavn` like 'domaene%') or ((`T3`.`datanavn` = 'varenavn') and (`T3`.`data` = 'SMS')))))) left join `ordrer` `T4` on(((`T1`.`ordrenr` = `T4`.`ordrenr`) and (`T4`.`datanavn` = 'pris')))) left join `sag` `T5` on((`T5`.`id` = (/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`)))))) where ((`T1`.`datanavn` = 'status') and (`T1`.`ordretype` = 'F') and (((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%'))) order by `T2`.`tid` limit 5000" } ] } }, { "join_optimization": { "select#": 1, "steps": [ { "transformations_to_nested_joins": { "transformations": [ "JOIN_condition_to_WHERE", "parenthesis_removal" ], "expanded_query": "/* select#1 */ select distinct `T2`.`tid` AS `tid`,`T1`.`data` AS `data`,`T2`.`data` AS `data`,`T1`.`ordrenr` AS `ordrenr`,`T1`.`nr` AS `nr`,`T4`.`data` AS `data`,`T3`.`data` AS `data`,`T1`.`ordretype` AS `ordretype`,`T5`.`aendret` AS `aendret`,`T5`.`info` AS `info` from `ordrer` `T1` join `ordrer` `T2` left join `ordrer` `T3` on(((`T1`.`ordrenr` = `T3`.`ordrenr`) and (`T1`.`ordretype` = `T3`.`ordretype`) and ((`T3`.`datanavn` like 'domaene%') or ((`T3`.`datanavn` = 'varenavn') and (`T3`.`data` = 'SMS'))))) left join `ordrer` `T4` on(((`T1`.`ordrenr` = `T4`.`ordrenr`) and (`T4`.`datanavn` = 'pris'))) left join `sag` `T5` on((`T5`.`id` = (/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`))))) where ((`T1`.`datanavn` = 'status') and (`T1`.`ordretype` = 'F') and (((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T1`.`ordrenr` = `T2`.`ordrenr`) and (`T1`.`ordretype` = `T2`.`ordretype`) and (`T2`.`datanavn` = 'emnefelt') and (`T2`.`data` like '%%%')) order by `T2`.`tid` limit 5000" } }, { "condition_processing": { "condition": "WHERE", "original_condition": "((`T1`.`datanavn` = 'status') and (`T1`.`ordretype` = 'F') and (((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T1`.`ordrenr` = `T2`.`ordrenr`) and (`T1`.`ordretype` = `T2`.`ordretype`) and (`T2`.`datanavn` = 'emnefelt') and (`T2`.`data` like '%%%'))", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "((((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T2`.`data` like '%%%') and multiple equal('status', `T1`.`datanavn`) and multiple equal('F', `T1`.`ordretype`, `T2`.`ordretype`) and multiple equal(`T1`.`ordrenr`, `T2`.`ordrenr`) and multiple equal('emnefelt', `T2`.`datanavn`))" }, { "transformation": "constant_propagation", "resulting_condition": "((((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T2`.`data` like '%%%') and multiple equal('status', `T1`.`datanavn`) and multiple equal('F', `T1`.`ordretype`, `T2`.`ordretype`) and multiple equal(`T1`.`ordrenr`, `T2`.`ordrenr`) and multiple equal('emnefelt', `T2`.`datanavn`))" }, { "transformation": "trivial_condition_removal", "resulting_condition": "((((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T2`.`data` like '%%%') and multiple equal('status', `T1`.`datanavn`) and multiple equal('F', `T1`.`ordretype`, `T2`.`ordretype`) and multiple equal(`T1`.`ordrenr`, `T2`.`ordrenr`) and multiple equal('emnefelt', `T2`.`datanavn`))" } ] } }, { "table_dependencies": [ { "table": "`ordrer` `T1`", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [ ] }, { "table": "`ordrer` `T2`", "row_may_be_null": false, "map_bit": 1, "depends_on_map_bits": [ ] }, { "table": "`ordrer` `T3`", "row_may_be_null": true, "map_bit": 2, "depends_on_map_bits": [ 0 ] }, { "table": "`ordrer` `T4`", "row_may_be_null": true, "map_bit": 3, "depends_on_map_bits": [ 0, 2 ] }, { "table": "`sag` `T5`", "row_may_be_null": true, "map_bit": 4, "depends_on_map_bits": [ 0, 2, 3 ] } ] }, { "ref_optimizer_key_uses": [ { "table": "`ordrer` `T1`", "field": "datanavn", "equals": "'status'", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "ordretype", "equals": "'F'", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "datanavn", "equals": "'status'", "null_rejecting": false }, { "table": "`ordrer` `T2`", "field": "datanavn", "equals": "'emnefelt'", "null_rejecting": false }, { "table": "`ordrer` `T2`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T2`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T2`", "field": "ordretype", "equals": "'F'", "null_rejecting": false }, { "table": "`ordrer` `T2`", "field": "datanavn", "equals": "'emnefelt'", "null_rejecting": false }, { "table": "`ordrer` `T3`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T3`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T3`", "field": "ordretype", "equals": "'F'", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "datanavn", "equals": "'pris'", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "datanavn", "equals": "'pris'", "null_rejecting": false }, { "table": "`sag` `T5`", "field": "id", "equals": "(/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`)))", "null_rejecting": false } ] }, { "rows_estimation": [ { "table": "`ordrer` `T1`", "range_analysis": { "table_scan": { "rows": 8311074, "cost": 1.75e6 }, "potential_range_indices": [ { "index": "PRIMARY", "usable": false, "cause": "not_applicable" }, { "index": "dnavnordre", "usable": true, "key_parts": [ "datanavn", "ordrenr" ] }, { "index": "ordrenr", "usable": false, "cause": "not_applicable" }, { "index": "data", "usable": true, "key_parts": [ "data" ] }, { "index": "ordretype", "usable": true, "key_parts": [ "ordretype" ] }, { "index": "tid", "usable": false, "cause": "not_applicable" }, { "index": "datanplusd", "usable": true, "key_parts": [ "datanavn", "data" ] } ], "setup_range_conditions": [ ], "group_index_range": { "chosen": false, "cause": "not_single_table" }, "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "dnavnordre", "ranges": [ "status <= datanavn <= status" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": true, "index_only": false, "rows": 233626, "cost": 222528, "chosen": true }, { "index": "ordretype", "ranges": [ "F <= ordretype <= F" ], "index_dives_for_eq_ranges": true, "rowid_ordered": true, "using_mrr": true, "index_only": false, "rows": 8309117, "cost": 3.83e6, "chosen": false, "cause": "cost" }, { "index": "datanplusd", "ranges": [ "status <= datanavn <= status" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 100832, "cost": 120999, "chosen": true } ], "analyzing_roworder_intersect": { "usable": false, "cause": "too_few_roworder_scans" } }, "chosen_range_access_summary": { "range_access_plan": { "type": "range_scan", "index": "datanplusd", "rows": 100832, "ranges": [ "status <= datanavn <= status" ] }, "rows_for_plan": 100832, "cost_for_plan": 120999, "chosen": true } } }, { "table": "`ordrer` `T2`", "range_analysis": { "table_scan": { "rows": 8311074, "cost": 1.75e6 }, "potential_range_indices": [ { "index": "PRIMARY", "usable": false, "cause": "not_applicable" }, { "index": "dnavnordre", | 66719 | 0 | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+-------------------------+ 1 row in set (0.00 sec) 23 rows in set (4.16 sec) +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+-------------------------+ | QUERY | TRACE | MISSING_BYTES_BEYOND_MAX_MEM_SIZE | INSUFFICIENT_PRIVILEGES | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+-------------------------+ | SELECT DISTINCT T2.tid, T1.data, T2.data, T1.ordrenr, T1.nr, T4.data, T3.data, T1.ordretype, T5.aendret, T5.info FROM `ordrer` AS T1 INNER JOIN `ordrer` AS T2 FORCE INDEX(datanplusd) ON T1.ordrenr = T2.ordrenr AND T1.ordretype = T2.ordretype AND T2.datanavn = 'emnefelt' AND T2.data LIKE '%%%' LEFT JOIN `ordrer` AS T3 ON T1.ordrenr = T3.ordrenr AND T1.ordretype = T3.ordretype AND ( T3.datanavn LIKE 'domaene%' OR ( T3.datanavn = 'varenavn' AND T3.data = 'SMS' ) ) LEFT JOIN `ordrer` AS T4 ON T1.ordrenr = T4.ordrenr AND T4.datanavn = 'pris' LEFT JOIN jthnet.`sag` AS T5 ON T5.id = ( SELECT MAX( id ) FROM jthnet.`sag` WHERE T3.data = navn AND T3.nr = nr ) WHERE T1.datanavn = 'status' AND T1.ordretype = 'F' AND ( ( T2.tid >= '2008-04-20 00:00:00' AND T2.tid <= '2008-04-20 23:59:59' AND T1.data LIKE '%' ) OR ( T1.data LIKE 'ny.authent%' ) ) ORDER BY T2.tid | { "steps": [ { "join_preparation": { "select#": 1, "steps": [ { "join_preparation": { "select#": 2, "steps": [ { "expanded_query": "/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`))" } ] } }, { "expanded_query": "/* select#1 */ select distinct `T2`.`tid` AS `tid`,`T1`.`data` AS `data`,`T2`.`data` AS `data`,`T1`.`ordrenr` AS `ordrenr`,`T1`.`nr` AS `nr`,`T4`.`data` AS `data`,`T3`.`data` AS `data`,`T1`.`ordretype` AS `ordretype`,`T5`.`aendret` AS `aendret`,`T5`.`info` AS `info` from ((((`ordrer` `T1` join `ordrer` `T2` FORCE INDEX (`datanplusd`) on(((`T1`.`ordrenr` = `T2`.`ordrenr`) and (`T1`.`ordretype` = `T2`.`ordretype`) and (`T2`.`datanavn` = 'emnefelt') and (`T2`.`data` like '%%%')))) left join `ordrer` `T3` on(((`T1`.`ordrenr` = `T3`.`ordrenr`) and (`T1`.`ordretype` = `T3`.`ordretype`) and ((`T3`.`datanavn` like 'domaene%') or ((`T3`.`datanavn` = 'varenavn') and (`T3`.`data` = 'SMS')))))) left join `ordrer` `T4` on(((`T1`.`ordrenr` = `T4`.`ordrenr`) and (`T4`.`datanavn` = 'pris')))) left join `sag` `T5` on((`T5`.`id` = (/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`)))))) where ((`T1`.`datanavn` = 'status') and (`T1`.`ordretype` = 'F') and (((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%'))) order by `T2`.`tid`" } ] } }, { "join_optimization": { "select#": 1, "steps": [ { "transformations_to_nested_joins": { "transformations": [ "JOIN_condition_to_WHERE", "parenthesis_removal" ], "expanded_query": "/* select#1 */ select distinct `T2`.`tid` AS `tid`,`T1`.`data` AS `data`,`T2`.`data` AS `data`,`T1`.`ordrenr` AS `ordrenr`,`T1`.`nr` AS `nr`,`T4`.`data` AS `data`,`T3`.`data` AS `data`,`T1`.`ordretype` AS `ordretype`,`T5`.`aendret` AS `aendret`,`T5`.`info` AS `info` from `ordrer` `T1` join `ordrer` `T2` FORCE INDEX (`datanplusd`) left join `ordrer` `T3` on(((`T1`.`ordrenr` = `T3`.`ordrenr`) and (`T1`.`ordretype` = `T3`.`ordretype`) and ((`T3`.`datanavn` like 'domaene%') or ((`T3`.`datanavn` = 'varenavn') and (`T3`.`data` = 'SMS'))))) left join `ordrer` `T4` on(((`T1`.`ordrenr` = `T4`.`ordrenr`) and (`T4`.`datanavn` = 'pris'))) left join `sag` `T5` on((`T5`.`id` = (/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`))))) where ((`T1`.`datanavn` = 'status') and (`T1`.`ordretype` = 'F') and (((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T1`.`ordrenr` = `T2`.`ordrenr`) and (`T1`.`ordretype` = `T2`.`ordretype`) and (`T2`.`datanavn` = 'emnefelt') and (`T2`.`data` like '%%%')) order by `T2`.`tid`" } }, { "condition_processing": { "condition": "WHERE", "original_condition": "((`T1`.`datanavn` = 'status') and (`T1`.`ordretype` = 'F') and (((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T1`.`ordrenr` = `T2`.`ordrenr`) and (`T1`.`ordretype` = `T2`.`ordretype`) and (`T2`.`datanavn` = 'emnefelt') and (`T2`.`data` like '%%%'))", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "((((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T2`.`data` like '%%%') and multiple equal('status', `T1`.`datanavn`) and multiple equal('F', `T1`.`ordretype`, `T2`.`ordretype`) and multiple equal(`T1`.`ordrenr`, `T2`.`ordrenr`) and multiple equal('emnefelt', `T2`.`datanavn`))" }, { "transformation": "constant_propagation", "resulting_condition": "((((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T2`.`data` like '%%%') and multiple equal('status', `T1`.`datanavn`) and multiple equal('F', `T1`.`ordretype`, `T2`.`ordretype`) and multiple equal(`T1`.`ordrenr`, `T2`.`ordrenr`) and multiple equal('emnefelt', `T2`.`datanavn`))" }, { "transformation": "trivial_condition_removal", "resulting_condition": "((((`T2`.`tid` >= '2008-04-20 00:00:00') and (`T2`.`tid` <= '2008-04-20 23:59:59') and (`T1`.`data` like '%')) or (`T1`.`data` like 'ny.authent%')) and (`T2`.`data` like '%%%') and multiple equal('status', `T1`.`datanavn`) and multiple equal('F', `T1`.`ordretype`, `T2`.`ordretype`) and multiple equal(`T1`.`ordrenr`, `T2`.`ordrenr`) and multiple equal('emnefelt', `T2`.`datanavn`))" } ] } }, { "table_dependencies": [ { "table": "`ordrer` `T1`", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [ ] }, { "table": "`ordrer` `T2` FORCE INDEX (`datanplusd`)", "row_may_be_null": false, "map_bit": 1, "depends_on_map_bits": [ ] }, { "table": "`ordrer` `T3`", "row_may_be_null": true, "map_bit": 2, "depends_on_map_bits": [ 0 ] }, { "table": "`ordrer` `T4`", "row_may_be_null": true, "map_bit": 3, "depends_on_map_bits": [ 0, 2 ] }, { "table": "`sag` `T5`", "row_may_be_null": true, "map_bit": 4, "depends_on_map_bits": [ 0, 2, 3 ] } ] }, { "ref_optimizer_key_uses": [ { "table": "`ordrer` `T1`", "field": "datanavn", "equals": "'status'", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "ordretype", "equals": "'F'", "null_rejecting": false }, { "table": "`ordrer` `T1`", "field": "datanavn", "equals": "'status'", "null_rejecting": false }, { "table": "`ordrer` `T2` FORCE INDEX (`datanplusd`)", "field": "datanavn", "equals": "'emnefelt'", "null_rejecting": false }, { "table": "`ordrer` `T3`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T3`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T3`", "field": "ordretype", "equals": "'F'", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "datanavn", "equals": "'pris'", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T1`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "ordrenr", "equals": "`T2`.`ordrenr`", "null_rejecting": false }, { "table": "`ordrer` `T4`", "field": "datanavn", "equals": "'pris'", "null_rejecting": false }, { "table": "`sag` `T5`", "field": "id", "equals": "(/* select#2 */ select max(`sag`.`id`) from `sag` where ((`T3`.`data` = `sag`.`navn`) and (`T3`.`nr` = `sag`.`nr`)))", "null_rejecting": false } ] }, { "rows_estimation": [ { "table": "`ordrer` `T1`", "range_analysis": { "table_scan": { "rows": 8311074, "cost": 1.75e6 }, "potential_range_indices": [ { "index": "PRIMARY", "usable": false, "cause": "not_applicable" }, { "index": "dnavnordre", "usable": true, "key_parts": [ "datanavn", "ordrenr" ] }, { "index": "ordrenr", "usable": false, "cause": "not_applicable" }, { "index": "data", "usable": true, "key_parts": [ "data" ] }, { "index": "ordretype", "usable": true, "key_parts": [ "ordretype" ] }, { "index": "tid", "usable": false, "cause": "not_applicable" }, { "index": "datanplusd", "usable": true, "key_parts": [ "datanavn", "data" ] } ], "setup_range_conditions": [ ], "group_index_range": { "chosen": false, "cause": "not_single_table" }, "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "dnavnordre", "ranges": [ "status <= datanavn <= status" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": true, "index_only": false, "rows": 233626, "cost": 222528, "chosen": true }, { "index": "ordretype", "ranges": [ "F <= ordretype <= F" ], "index_dives_for_eq_ranges": true, "rowid_ordered": true, "using_mrr": true, "index_only": false, "rows": 8309117, "cost": 3.83e6, "chosen": false, "cause": "cost" }, { "index": "datanplusd", "ranges": [ "status <= datanavn <= status" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 100832, "cost": 120999, "chosen": true } ], "analyzing_roworder_intersect": { "usable": false, "cause": "too_few_roworder_scans" } }, "chosen_range_access_summary": { "range_access_plan": { "type": "range_scan", "index": "datanplusd", "rows": 100832, "ranges": [ "status <= datanavn <= status" ] }, "rows_for_plan": 100832, "cost_for_plan": 120999, "chosen": true } } }, { "table": "`ordrer` `T2` FORCE INDEX (`datanplusd`)", "range_analysis": { "table_scan": { "rows": 8311074, "cost": 2e308 }, "potential_range_indices": [ { "index": "PRIMARY", "usable": false, "cause": "not_applicable" }, { "index": "dnavnordre", "usable": false, "cause": "not_applicable" }, { "index": "ordrenr", "usable": false, "cause": "not_applicable" }, { "index": "data", "usable": false, "cause": "not_applicable" }, { "index": "ordretype", "usable": false, "cause": "not_applicable" }, { | 76964 | 0 | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+-------------------------+ 1 row in set (0.00 sec)