Slow insert speed in Postgresql memory tablespace
- by Prashant
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