title: Which query plan is faster/better
body: <p>I have two query plans for different queries that return the same results
  I'm wondering if someone can tell me which one is "better", and why.</p>
  
  <pre><code>SELECT * 
  FROM bids order by (select ranking from users where users.id = runner_id) DESC limit 1
  
  
  "Limit  (cost=17.62..17.62 rows=1 width=568)"
  "  -&gt;  Sort  (cost=17.62..17.62 rows=2 width=568)"
  "        Sort Key: ((SubPlan 1))"
  "        -&gt;  Seq Scan on bids  (cost=0.00..17.61 rows=2 width=568)"
  "              SubPlan 1"
  "                -&gt;  Index Scan using users_pkey on users  (cost=0.28..8.29 rows=1 width=4)"
  "                      Index Cond: (id = bids.runner_id)"
  </code></pre>
  
  <p>Second statement and plan:</p>
  
  <pre><code>SELECT  "bids".* 
  FROM "bids" inner join users u on bids.runner_id=u.id  ORDER BY u.ranking DESC LIMIT 1
  
  "Limit  (cost=17.64..17.64 rows=1 width=572)"
  "  -&gt;  Sort  (cost=17.64..17.64 rows=2 width=572)"
  "        Sort Key: u.ranking"
  "        -&gt;  Nested Loop  (cost=0.28..17.63 rows=2 width=572)"
  "              -&gt;  Seq Scan on bids  (cost=0.00..1.02 rows=2 width=568)"
  "              -&gt;  Index Scan using users_pkey on users u  (cost=0.28..8.29 rows=1 width=8)"
  "                    Index Cond: (id = bids.runner_id)"
  </code></pre>