title: PostgreSQL range query index
body: <p>Let's say I have a simple table in PostgreSQL:</p>
  
  <pre><code>CREATE TABLE bingest.some_data (
        report_date DATE NOT NULL,
        client_id UUID NOT NULL,
        value_1 INT, value_2 INT, value_3 INT,
        value_4 INT, value_5 INT, value_6 INT,
        value_7 INT, value_8 INT, value_9 INT,
        value_10 INT, value_11 INT, value_12 INT,
        value_13 INT, value_14 INT, value_15 INT,
        value_16 INT, value_17 INT, value_18 INT,
        value_19 INT,
  PRIMARY KEY (report_date, client_id));
  </code></pre>
  
  <p>I want to have the index used in the following query</p>
  
  <pre><code>SELECT * FROM some_data WHERE report_date &gt; '2018-10-30';
  </code></pre>
  
  <p>For the above query the <strong>EXPLAIN</strong> command gives me this</p>
  
  <pre><code>Seq Scan on some_data  (cost=0.00..18.12 rows=217 width=96)
      Filter: (report_date &gt; '2018-10-30'::date)
  Planning time: 0.061 ms
  Execution time: 0.019 ms
  </code></pre>
  
  <p>The index is used when I specify upper and lower bounds </p>
  
  <pre><code>SELECT * FROM some_data WHERE report_date &gt; '2018-10-30' AND &lt; '2019-10-30'
  </code></pre>
  
  <p>For this one <strong>EXPLAIN</strong> gives the following output:</p>
  
  <pre><code>Bitmap Heap Scan on some_data  (cost=4.18..11.30 rows=3 width=96)
      Recheck Cond: ((report_date &gt; '2018-10-30'::date) AND (report_date &lt; '2019-10-30'::date))
          -&gt;  Bitmap Index Scan on some_data_pkey  (cost=0.00..4.18 rows=3 width=0)
                  Index Cond: ((report_date &gt; '2018-10-30'::date) AND (report_date &lt; '2019-10-30'::date))
  Planning time: 0.072 ms
  Execution time: 0.027 ms
  </code></pre>
  
  <p>I do not have any data yet but I want to prepare right indexes for this table.</p>