title: django queryset runtime - get nth entry in constant time
body: <p>I'm using multiple ways to get data from db via different django querysets,
  but I would like to know the runtime for each queryset and if possible a better way (to maybe get data in constant time!!)</p>
  
  <pre><code>qs = MyModel.objects.order_by('-time')
  qs = qs.filter(blah = blah)
  </code></pre>
  
  <p>to get the first entry I'm doing this: </p>
  
  <pre><code>entry = list(qs[:1])
  first_entry = entry[0]
  </code></pre>
  
  <p>or to get 10th and last entry:</p>
  
  <pre><code>entry = list(qs)
  some_entry = entry[9]
  last_entry = entry[-1] 
  </code></pre>
  
  <p>but I believe this will take O(n) time, is there anyway to get the nth term in constant time?
  I dont want to use get() as I dont know the id or other value of the entry(its sorted), but only the position.</p>
  
  <p>I may also use annotate, but this also take O(n) runtime.</p>
  
  <pre><code>MyModel.objects.values('date').annotate(min_value=Min('value')).order_by('min_value')[0] 
  </code></pre>
  
  <p><em>I know the position just need that entry in constant time?</em></p>