We discussed in an earlier post how to design indexes for many types of queries using a single table. Here is a real-world example of the challenges you will face when trying to optimize queries: two similar queries, but one is performing a full table scan while the other one is using the index we specially created for these queries. Bug or expected behavior? Read on!
Our two similar queries
# Q1 mysql> explain select col1, col2 from t where ts >= '2015-04-30 00:00:00'; …[Read more...]