title: Make a query with DISTINCT clause run faster
body: <p>I have the following query:</p>
  
  <pre><code>select distinct type, account 
    from balances_tbl 
   where month = 'DEC-12'
  </code></pre>
  
  <p>The table <code>balances_tbl</code> has over 3 million records per month. The distinct type and account rows are maybe around 20,000 records. The <code>month</code> column is indexed. The <code>type</code> and <code>account</code> columns are also indexed. The query takes a really long time (about 30 minutes) to execute. </p>
  
  <p>Is there a way to make this query with the <code>DISTINCT</code> clause faster?</p>