title: What is the difference between a LATERAL JOIN and a subquery in PostgreSQL?
body: <p>Since PostgreSQL came out with the ability to do <code>LATERAL</code> joins, I've been reading up on it since I currently do complex data dumps for my team with lots of inefficient subqueries that make the overall query take four minutes or more.</p>
  <p>I understand that <code>LATERAL</code> joins may be able to help me, but even after reading articles like <a href="http://blog.heapanalytics.com/postgresqls-powerful-new-join-type-lateral/" rel="noreferrer">this one</a> from Heap Analytics, I still don't quite follow.</p>
  <p>What is the use case for a <code>LATERAL</code> join? What is the difference between a <code>LATERAL</code> join and a subquery?</p>