title: Django QuerySet access foreign key field directly, without forcing a join
body: <p>Suppose you have a model Entry, with a field "author" pointing to another model Author. Suppose this field can be null.</p>
  
  <p>If I run the following QuerySet:</p>
  
  <p>Entry.objects.filter(author=X)</p>
  
  <p>Where X is some value. Suppose in MySQL I have setup a compound index on Entry for some other column and author_id, ideally I'd like the SQL to just use "author_id" on the Entry model, so that it can use the compound index.</p>
  
  <p>It turns out that Entry.objects.filter(author=5) would work, no join is done. But, if I say author=None, Django does a join with Author, then add to the Where clause Author.id IS NULL. So in this case, it can't use the compound index.</p>
  
  <p>Is there a way to tell Django to just check the pk, and not follow the link? </p>
  
  <p>The only way I know is to add an additional .extra(where=['author_id IS NULL']) to the QuerySet, but I was hoping some magic in .filter() would work.</p>
  
  <p>Thanks.</p>
  
  <p>(Sorry I was not clearer earlier about this, and thanks for the answers from lazerscience and Josh).</p>