Nested preloading in Ecto
<p>I am trying to write a nested query in ecto which preloads <code>comments</code> from the post table and then in a separate query I am preloading the <code>user</code> for each comment. This looks like:</p>

<pre><code>post = Repo.preload(Repo.get(Post, id), [:comments])
comments = Repo.preload(post.comments, [:user])
</code></pre>

<p>The problem with this is that it runs 3 different queries on the database when I know there is a way to load all the data I need in one query.</p>

<p>Is it something to do with <code>join: assoc()</code>?</p>