title: Laravel slow performance on pagination with large data
body: <p>I have 100k record in my <code>posts</code> table and 100k records in <code>users</code> table.</p>
  
  <p>When i use <code>laravel's</code> pagination. it takes too long to return data...!</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>$posts = Post::join('users', 'posts.user_id', 'users.id')
      -&gt;where('posts.status', '=', 1)
      -&gt;where('users.status', '=', 1)
      -&gt;paginate(10);
  </code></pre>
  
  <p>How can i fix this and got better performance?</p>
  
  <p><strong>Note</strong></p>
  
  <p>I have this problem also when i use <code>inRandomOrder()</code> on <code>$posts</code></p>