title: Should I split one collection into two collections for performance?
body: <p>I have a collection of users. </p>
  
  <p>Every user has some <strong>basic attributes</strong> : name, adress, zipcode ...</p>
  
  <p>But every user has also some much more space-taking attributes: <strong>statistics</strong>.</p>
  
  <p>The statistics attribute contains an array that is more than 10 times bigger than all other attributes put together.</p>
  
  <p>My question is the following:</p>
  
  <p>Should I split my collection into a user collection and a user stats collection ? The <strong>user collection</strong> would contain the <strong>basic attributes</strong>, and the <strong>user_stats collection</strong> would be the users but <strong>with the statistics</strong>. Then I could use the user collection when I want to retrieve only basic information, and the user_stats collection when I really need the stats.</p>
  
  <p>If I for example search all names of all users:</p>
  
  <pre><code>userCollection.find({},{"name":true});
  </code></pre>
  
  <p>Will they be a difference in performance between the case where I have only one collection and the case where I have two ? Will this difference be linear (imo that will be the case, and the linear factor would be the ratio of the size of one document)?</p>
  
  <p>The general question that it infers is: does mongodb lose in performance when the size of the documents becomes bigger (selecting the same attributes) ?</p>
  
  <h3>UPDATE</h3>
  
  <p>The attributes in the statistics are in an array that will become larger over time (The more the user uses the app). They is no limit to this array, but most of the users (90%) won't have a statistics attribute that is larger than 10 times the other attributes. However, a small part of the users (1-2%) have a statistics attribute which is the size of 500 times the other attributes. </p>
  
  <p>I need this data so I'm not concerned about storage, but more about performance.</p>
  
  <p>They are basically two cases where I fetch data from the users collection:</p>
  
  <ul>
  <li><p>When I show a <strong>list of users</strong>, I will not fetch the statistics: I only project the <strong>name attribute</strong> and some others, which are limited in space.</p></li>
  <li><p>When I show <strong>one user</strong>, I <strong>fetch the statistics</strong>: Basically I will project all statistics attributes + some others.</p></li>
  </ul>