title: Simple SELECT query is slow with large table
body: <p>I have a table with the following structure</p>
  
  <pre><code>SHOW CREATE TABLE data_temperature;
  
  CREATE TABLE `data_temperature` (
    `temperature_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `data_id` bigint(20) unsigned NOT NULL,
    `x_id` varchar(32) DEFAULT NULL,
    `x_sn` varchar(16) DEFAULT NULL,
    `x_unit` char(1) DEFAULT NULL,
    `x_value` decimal(6,2) DEFAULT NULL,
    PRIMARY KEY (`temperature_id`),
    KEY `created` (`created`),
    KEY `data_id` (`data_id`),
    KEY `x_value` (`x_value`)
  ) ENGINE=InnoDB AUTO_INCREMENT=6274618 DEFAULT CHARSET=latin1
  </code></pre>
  
  <p>I have a somewhat basic query pulling data from here that's really slow.  So I've broken the query down into simpler terms and found that this very simple query is slow (17.52 seconds):</p>
  
  <pre><code>SELECT data_temperature.x_value FROM data_temperature WHERE data_temperature.created BETWEEN '2015-02-02 18:28:42' AND '2015-03-04 18:28:42';
  </code></pre>
  
  <p>The table has 6,274,617 rows.  In fact, <code>SELECT COUNT(*) FROM data_temperature</code> takes 3.66 seconds as well.</p>
  
  <p>The system that this query is running on is my dev system, which is a quad-core running Ubuntu 14.04, 4GB of RAM, and a solid-state drive.</p>
  
  <p>Is this about how long it should take to run a query like this, or am I doing something wrong?  Is there a more efficient way to return the data?</p>