Slow insert speed in Postgresql memory tablespace

Posted by Prashant on Stack Overflow See other posts from Stack Overflow or by Prashant
Published on 2010-05-28T06:30:57Z Indexed on 2010/05/28 6:31 UTC
Read the original article Hit count: 435

Filed under:
|

Hi,

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.

I have also done the following tuning in the postgres config:

  • Indexes : no
  • fsync : false
  • logging : disabled

Other information: - Tablespace : RAM - Number of columns in one row : 25 (mostly integers) - CPU : 4 core, 2.5 GHz - RAM : 48 GB

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?

Help appreciated.

Prashant

© Stack Overflow or respective owner

Related posts about postgresql

Related posts about insertion