title: MySQL: Get the first row that has a field >= value - is there a way to speed it up?
body: <p>There is a table:</p>
  
  <pre><code>CREATE TABLE `test` (
    `thing` int(10) unsigned NOT NULL,
    `price` decimal(10,2) unsigned NOT NULL,
    PRIMARY KEY (`thing`,`price`),
    KEY `thing` (`thing`),
    KEY `price` (`price`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>and some values there:</p>
  
  <pre><code>INSERT INTO test(thing,price)
  VALUES
  (1,5.00),
  (2,7.50),
  (3,8.70),
  (4,9.00),
  (5,9.50),
  (6,9.75),
  (7,10.00),
  (8,10.50),
  (9,10.75),
  (10,11.00),
  (11,11.25);
  </code></pre>
  
  <p>I want to get a MINIMAL <code>price</code> from this table, that is MORE than, say, <code>9.2</code> - that is <code>(5,9.50)</code> record. So, I do:
  <code>SELECT thing, price FROM test WHERE price &gt; 9.2 ORDER BY price LIMIT 1</code> . It's EXPLAIN output says that MySQL goes through all 7 rows that are more than 9.2:</p>
  
  <pre><code>id  select_type table   type    possible_keys   key key_len ref rows    Extra
  1   SIMPLE  test    range   price   price   5   \N  7   Using where; Using index
  </code></pre>
  
  <p>Is there a way to speed this up somehow? So that MySQL would give me ONE record that is a little more than my condition?</p>
  
  <p>Thanks in advance for your help!</p>