title: 1 very large table or 3 large table? MySQL Performance
body: <p>Assume a very large database. A table with 900 million records.</p>
  
  <p><strong>Method A:</strong><br>
  Table: Posts</p>
  
  <pre><code>+----------+-------------- +------------------+----------------+
  | id (int) | item_id (int) | post_type (ENUM) | Content (TEXT) |
  +----------+---------------+------------------+----------------+
  |    1     |      1        |       user       |  some text ... |
  +----------+---------------+------------------+----------------+
  |    2     |      1        |       page       |  some text ... |
  +----------+---------------+------------------+----------------+
  |    3     |      1        |       group      |  some text ... |
  
  // row 1 : User with ID 1 has a post with ID #1
  // row 2 : Page with ID 1 has a post with ID #2
  // row 3 : Group with ID 1 has a post with ID #3
  </code></pre>
  
  <p>The goal is displaying 20 records from all 3 <code>post_types</code> in a page.</p>
  
  <pre><code>SELECT * FROM posts LIMIT 20
  </code></pre>
  
  <p><strong>But I am worried about number of records for this method</strong></p>
  
  <p><strong>Method B:</strong><br>
  Separate 900 million records to 3 tables with 300 millions for each one.</p>
  
  <p>Table: User Posts</p>
  
  <pre><code>+----------+-------------- +----------------+
  | id (int) | user_id (int) | Content (TEXT) |
  +----------+---------------+----------------+
  |    1     |      1        |  some text ... |
  +----------+---------------+----------------+
  |    2     |      2        |  some text ... |
  +----------+---------------+----------------+
  |    3     |      3        |  some text ... |
  </code></pre>
  
  <p>Table: Page Posts</p>
  
  <pre><code>+----------+-------------- +----------------+
  | id (int) | page_id (int) | Content (TEXT) |
  +----------+---------------+----------------+
  |    1     |      1        |  some text ... |
  +----------+---------------+----------------+
  |    2     |      2        |  some text ... |
  +----------+---------------+----------------+
  |    3     |      3        |  some text ... |
  </code></pre>
  
  <p>Table: Group Posts</p>
  
  <pre><code>+----------+----------------+----------------+
  | id (int) | group_id (int) | Content (TEXT) |
  +----------+----------------+----------------+
  |    1     |      1         |  some text ... |
  +----------+----------------+----------------+
  |    2     |      2         |  some text ... |
  +----------+----------------+----------------+
  |    3     |      3         |  some text ... |
  </code></pre>
  
  <p>now to get a list of 20 posts to display</p>
  
  <pre><code>SELECT * FROM User_Posts LIMIT 10
  SELECT * FROM Page_Posts LIMIT 10
  SELECT * FROM group_posts LIMIT 10
  </code></pre>
  
  <p>// and make an array or object of result. and display in output.</p>
  
  <p><strong>In this method, I should sort them in an array in php, and then semd them to page.</strong></p>
  
  <p>Which method is preferred?<br>
  Separating a 900 million records table to three tables will affect on speed of reading and writing in mysql?</p>