Insertions slower than Updates?

From: Ofer Israeli <oferi(at)checkpoint(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Cc: Olga Vingurt <olgavi(at)checkpoint(dot)com>, Netta Kabala <nettak(at)checkpoint(dot)com>
Subject: Insertions slower than Updates?
Date: 2012-02-20 18:59:36
Message-ID: 217DDBC2BB1E394CA9E7446337CBDEF20102C05A6A37@il-ex01.ad.checkpoint.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi all,

In performance testing we're doing we are currently running two scenarios:

1. Starting from an empty db, therefore all operations are INSERTs.
2. Starting from an existing db - thereby UPDATing all records.

I should also mention that the tables we are dealing with are heavily indexed.

I would expect that the first scenario would give much better results than the second one as:

1. INSERT should be cheaper than UPDATE due to only dealing with one record instead of two.
2. We also have SELECT queries before the operation and in the first configuration, the SELECTs will be dealing with much less data for most of the run.

To our surprise, we see that the second scenario gives better results with an average processing time of an event at around %70 of the time run in the first scenario.

Anyone have any ideas on why the empty db is giving worse results??

Many Thanks,
Ofer

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2012-02-20 19:13:11 Re: Insertions slower than Updates?
Previous Message Merlin Moncure 2012-02-20 17:32:06 Re: Query slow as function