title: in postgresql, are partitions or multiple databases more efficient?
body: <p>have an application in which many companies post information.  the data from each company is self contained - there is no data overlap.</p>
  
  <p>performance-wise, is it better to:</p>
  
  <ul>
  <li>keep the company ID on each row of each table and have each index use it?</li>
  <li>partition each table according to the company ID</li>
  <li>partition and create a user to access each company to ensure security</li>
  <li>create multiple databases, one for each company</li>
  </ul>
  
  <p>web-based application with persistent connections.</p>
  
  <p>my thoughts:</p>
  
  <ul>
  <li>new pg connections are expensive, so a single database creates less new connections</li>
  <li>having only one copy of the dictionary seems more efficient than 200 or so</li>
  <li>multiple databases are certainly safer from programmer error</li>
  <li>if application specs should change so companies share, multiple data
  base would be difficult to implement</li>
  </ul>