title: Postgresql, Using Index with Between
body: <p>I have index on a column, let's say <code>ID</code> (bigint).   If I have a query with something like this:</p>
  
  <pre><code>SELECT * 
    FROM table 
   WHERE id = 12345
  </code></pre>
  
  <p>...it will use index. But when I'm using query like...</p>
  
  <pre><code>SELECT * 
    FROM table 
   WHERE id &gt;= 12345 
     AND id &lt;= 12366
  </code></pre>
  
  <p>It use sequential scan, which is very slow.  Can I force using the ID index?</p>