title: Slow insert speed in Postgresql memory tablespace
body: <p>I have a requirement where I need to store the records at rate of 10,000 records/sec into a database (with indexing on a few fields). Number of columns in one record is 25. I am doing a batch insert of 100,000 records in one transaction block. To improve the insertion rate, I changed the tablespace from disk to RAM.With that I am able to achieve only 5,000 inserts per second. </p>
  
  <p>I have also done the following tuning in the postgres config:</p>
  
  <ul>
  <li>Indexes : no</li>
  <li>fsync : false</li>
  <li>logging : disabled</li>
  </ul>
  
  <p>Other information:</p>
  
  <ul>
  <li>Tablespace : RAM</li>
  <li>Number of columns in one row : 25 (mostly integers)</li>
  <li>CPU : 4 core, 2.5 GHz</li>
  <li>RAM : 48 GB</li>
  </ul>
  
  <p>I am wondering why a single insert query is taking around 0.2 msec on average when database is not writing anything on disk (as I am using RAM based tablespace). Is there something I am doing wrong?</p>
  
  <p>Help appreciated.</p>
  
  <p>Prashant</p>