title: Would a partial index be used on a query?
body: <p>Given this partial index:</p>
  
  <pre><code>CREATE INDEX orders_id_created_at_index 
     ON orders(id) WHERE created_at &lt; '2013-12-31';
  </code></pre>
  
  <p>Would this query use the index?</p>
  
  <pre><code>SELECT * 
  FROM orders 
  WHERE id = 123 AND created_at = '2013-10-12';
  </code></pre>
  
  <p>As per the <a href="http://www.postgresql.org/docs/9.2/static/indexes-partial.html" rel="nofollow">documentation</a>, "a partial index can be used in a query only if the system can recognize that the WHERE condition of the query mathematically implies the predicate of the index". </p>
  
  <p>Does that mean that the index will or will not be used?</p>