title: Increase PostgreSQL write speed at the cost of likely data loss?
body: <p>I love that PostgreSQL is crash resistant, as I don't want to spend time <em>fixing a database</em>. However, I'm sure there must be some things I can disable/modify so that inserts/updates will work faster even if I <em>lose a couple records</em> prior to a power-outage / crash. I'm not worried about a couple records - just the database as a whole.</p>
  
  <p>I am trying to optimize PostgreSQL for large amounts of writes. It currently takes 22 minutes to insert 1 million rows which seems a bit slow. </p>
  
  <p><strong>How can I speed up PostgreSQL writes?</strong></p>
  
  <p>Some of the options I have looked into (like full_page_writes), seem to also run the risk of corrupting data which isn't something I want. I don't mind lost data - I just don't want corruption.</p>
  
  <h2>Update 1</h2>
  
  <p>Here is the table I am using - this since most of the tables will contain ints and small strings this "sample" table seems to be the best example of what I should expect.</p>
  
  <pre><code>CREATE TABLE "user"
  (
    id serial NOT NULL,
    username character varying(40),
    email character varying(70),
    website character varying(100),
    created integer,
    CONSTRAINT user_pkey PRIMARY KEY (id)
  )
  WITH ( OIDS=FALSE );
  CREATE INDEX id ON "user" USING btree (id);
  </code></pre>
  
  <p>I have about 10 scripts each issuing 100,000 requests at a time using prepared statements. This is to simulate a real-life load my application will be giving the database. In my application each page has 1+ inserts.</p>
  
  <h2>Update 2</h2>
  
  <p>I am using asynchronous commits already, because I have</p>
  
  <blockquote>
    <p>synchronous_commit = off</p>
  </blockquote>
  
  <p>in the main configuration file.</p>