Optimizing postgresql table for more than 100K inserts per second
UNLOGGEDtable. This reduces the amount of data written to persistent storage by up to 2x.
WITH (autovacuum_enabled=false)on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we never
- Insert rows with
COPY FROM STDIN. This is the fastest possible approach to insert rows into table.
- Minimize the number of indexes in the table, since they slow down inserts. Usually an index
time timestamp with time zoneis enough.
synchronous_commit = offto
- Use table inheritance for fast removal of old data: