And Optimizer Trace:: QUERY: SELECT installation_id, node_id, gateway_id, relay_gateway_id, signal_id, time, rec_time FROM Stowlen.IDontKnoo_1203 FORCE index(IDontKnoo_insid_time_ix) WHERE installation_id=594100 AND time>'2014-12-13 22:20:59' AND node_id=34267405 AND (gateway_id<>34267405 OR relay_gateway_id<>34267405) AND signal_id<>12 AND rec_seqno>=0 ORDER BY time LIMIT 1 TRACE: { "steps": [ { "join_preparation": { "select#": 1, "steps": [ { "expanded_query": "/* select#1 */ select `Stowlen`.`IDontKnoo_1203`.`installation_id` AS `installation_id`,`Stowlen`.`IDontKnoo_1203`.`node_id` AS `node_id`,`Stowlen`.`IDontKnoo_1203`.`gateway_id` AS `gateway_id`,`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` AS `relay_gateway_id`,`Stowlen`.`IDontKnoo_1203`.`signal_id` AS `signal_id`,`Stowlen`.`IDontKnoo_1203`.`time` AS `time`,`Stowlen`.`IDontKnoo_1203`.`rec_time` AS `rec_time` from `Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`) where ((`Stowlen`.`IDontKnoo_1203`.`installation_id` = 594100) and (`Stowlen`.`IDontKnoo_1203`.`time` > '2014-12-13 22:20:59') and (`Stowlen`.`IDontKnoo_1203`.`node_id` = 34267405) and ((`Stowlen`.`IDontKnoo_1203`.`gateway_id` <> 34267405) or (`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` <> 34267405)) and (`Stowlen`.`IDontKnoo_1203`.`signal_id` <> 12) and (`Stowlen`.`IDontKnoo_1203`.`rec_seqno` >= 0)) order by `Stowlen`.`IDontKnoo_1203`.`time` limit 1" } ] } }, { "join_optimization": { "select#": 1, "steps": [ { "condition_processing": { "condition": "WHERE", "original_condition": "((`Stowlen`.`IDontKnoo_1203`.`installation_id` = 594100) and (`Stowlen`.`IDontKnoo_1203`.`time` > '2014-12-13 22:20:59') and (`Stowlen`.`IDontKnoo_1203`.`node_id` = 34267405) and ((`Stowlen`.`IDontKnoo_1203`.`gateway_id` <> 34267405) or (`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` <> 34267405)) and (`Stowlen`.`IDontKnoo_1203`.`signal_id` <> 12) and (`Stowlen`.`IDontKnoo_1203`.`rec_seqno` >= 0))", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "((`Stowlen`.`IDontKnoo_1203`.`time` > '2014-12-13 22:20:59') and ((`Stowlen`.`IDontKnoo_1203`.`gateway_id` <> 34267405) or (`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` <> 34267405)) and (`Stowlen`.`IDontKnoo_1203`.`signal_id` <> 12) and (`Stowlen`.`IDontKnoo_1203`.`rec_seqno` >= 0) and multiple equal(594100, `Stowlen`.`IDontKnoo_1203`.`installation_id`) and multiple equal(34267405, `Stowlen`.`IDontKnoo_1203`.`node_id`))" }, { "transformation": "constant_propagation", "resulting_condition": "((`Stowlen`.`IDontKnoo_1203`.`time` > '2014-12-13 22:20:59') and ((`Stowlen`.`IDontKnoo_1203`.`gateway_id` <> 34267405) or (`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` <> 34267405)) and (`Stowlen`.`IDontKnoo_1203`.`signal_id` <> 12) and (`Stowlen`.`IDontKnoo_1203`.`rec_seqno` >= 0) and multiple equal(594100, `Stowlen`.`IDontKnoo_1203`.`installation_id`) and multiple equal(34267405, `Stowlen`.`IDontKnoo_1203`.`node_id`))" }, { "transformation": "trivial_condition_removal", "resulting_condition": "((`Stowlen`.`IDontKnoo_1203`.`time` > '2014-12-13 22:20:59') and ((`Stowlen`.`IDontKnoo_1203`.`gateway_id` <> 34267405) or (`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` <> 34267405)) and (`Stowlen`.`IDontKnoo_1203`.`signal_id` <> 12) and (`Stowlen`.`IDontKnoo_1203`.`rec_seqno` >= 0) and multiple equal(594100, `Stowlen`.`IDontKnoo_1203`.`installation_id`) and multiple equal(34267405, `Stowlen`.`IDontKnoo_1203`.`node_id`))" } ] } }, { "table_dependencies": [ { "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [ ] } ] }, { "ref_optimizer_key_uses": [ { "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "field": "installation_id", "equals": "594100", "null_rejecting": false } ] }, { "rows_estimation": [ { "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "range_analysis": { "table_scan": { "rows": 140476171, "cost": 2e308 }, "potential_range_indices": [ { "index": "IDontKnoo_time_ix", "usable": false, "cause": "not_applicable" }, { "index": "IDontKnoo_insid_time_ix", "usable": true, "key_parts": [ "installation_id", "time" ] }, { "index": "IDontKnoo_insid_sid_time_ix", "usable": false, "cause": "not_applicable" }, { "index": "IDontKnoo_insid_sid_zone_time_ix", "usable": false, "cause": "not_applicable" }, { "index": "IDontKnoo_insid_zone_time_ix", "usable": false, "cause": "not_applicable" } ], "setup_range_conditions": [ ], "group_index_range": { "chosen": false, "cause": "not_group_by_or_distinct" }, "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "IDontKnoo_insid_time_ix", "ranges": [ "594100 <= installation_id <= 594100 AND 2014-12-13 22:20:59 < time" ], "index_dives_for_eq_ranges": true, "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 224665, "cost": 269599, "chosen": true } ], "analyzing_roworder_intersect": { "usable": false, "cause": "too_few_roworder_scans" } }, "chosen_range_access_summary": { "range_access_plan": { "type": "range_scan", "index": "IDontKnoo_insid_time_ix", "rows": 224665, "ranges": [ "594100 <= installation_id <= 594100 AND 2014-12-13 22:20:59 < time" ] }, "rows_for_plan": 224665, "cost_for_plan": 269599, "chosen": true } } } ] }, { "considered_execution_plans": [ { "plan_prefix": [ ], "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "best_access_path": { "considered_access_paths": [ { "access_type": "ref", "index": "IDontKnoo_insid_time_ix", "rows": 224665, "cost": 269598, "chosen": true }, { "access_type": "range", "rows": 168499, "cost": 314532, "chosen": false } ] }, "cost_for_plan": 269598, "rows_for_plan": 224665, "chosen": true } ] }, { "attaching_conditions_to_tables": { "original_condition": "((`Stowlen`.`IDontKnoo_1203`.`node_id` = 34267405) and (`Stowlen`.`IDontKnoo_1203`.`installation_id` = 594100) and (`Stowlen`.`IDontKnoo_1203`.`time` > '2014-12-13 22:20:59') and ((`Stowlen`.`IDontKnoo_1203`.`gateway_id` <> 34267405) or (`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` <> 34267405)) and (`Stowlen`.`IDontKnoo_1203`.`signal_id` <> 12) and (`Stowlen`.`IDontKnoo_1203`.`rec_seqno` >= 0))", "attached_conditions_computation": [ { "access_type_changed": { "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "index": "IDontKnoo_insid_time_ix", "old_type": "ref", "new_type": "range", "cause": "uses_more_keyparts" } } ], "attached_conditions_summary": [ { "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "attached": "((`Stowlen`.`IDontKnoo_1203`.`node_id` = 34267405) and (`Stowlen`.`IDontKnoo_1203`.`installation_id` = 594100) and (`Stowlen`.`IDontKnoo_1203`.`time` > '2014-12-13 22:20:59') and ((`Stowlen`.`IDontKnoo_1203`.`gateway_id` <> 34267405) or (`Stowlen`.`IDontKnoo_1203`.`relay_gateway_id` <> 34267405)) and (`Stowlen`.`IDontKnoo_1203`.`signal_id` <> 12) and (`Stowlen`.`IDontKnoo_1203`.`rec_seqno` >= 0))" } ] } }, { "clause_processing": { "clause": "ORDER BY", "original_clause": "`Stowlen`.`IDontKnoo_1203`.`time`", "items": [ { "item": "`Stowlen`.`IDontKnoo_1203`.`time`" } ], "resulting_clause_is_simple": true, "resulting_clause": "`Stowlen`.`IDontKnoo_1203`.`time`" } }, { "refine_plan": [ { "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "access_type": "range" } ] }, { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", "index_order_summary": { "table": "`Stowlen`.`IDontKnoo_1203` FORCE INDEX (`IDontKnoo_insid_time_ix`)", "index_provides_order": true, "order_direction": "asc", "index": "IDontKnoo_insid_time_ix", "plan_changed": false } } } ] } }, { "join_execution": { "select#": 1, "steps": [ ] } } ] } MISSING_BYTES_BEYOND_MAX_MEM_SIZE: 0 INSUFFICIENT_PRIVILEGES: 0