title: Faster query than distinct in django
body: <p>I am using <strong>Django</strong> and <strong>PostgreSQL</strong>, and I have query like below</p>
  <pre><code>
  model.objects.filter(field=str(field)).exclude(tr__in=['some','some1']).distinct(
  'field1','field2')
  
  </code></pre>
  <p>In my model, I have 1 milion rows. The query above is so slow (It takes around 5-6 secs to fetch). I need alternative and faster way to implement it. Any ideas how to do?</p>