pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@tm.ee>
To: Mindaugas Riauba <mind@bi.lt>
Cc: pgsql-performance@postgresql.org
Subject: Re: Need advice about triggers
Date: Tue, 09 Sep 2003 18:18:03 +0300
Message-ID: <1063120683.6150.43.camel@fuji.krosing.net> (raw)
In-Reply-To: <00be01c376cf$91510620$f20214ac@bite.lt>
References: <00be01c376cf$91510620$f20214ac@bite.lt>

Mindaugas Riauba kirjutas T, 09.09.2003 kell 15:40:
>   Hello,
> 
>   I have small table (up to 10000 rows) and every row will be updated
> once per minute. Table also has "before update on each row" trigger
> written in plpgsql. But trigger 99.99% of the time will do nothing
> to the database. It will just compare old and new values in the row
> and those values almost always will be identical.
> 
>   Now I tried simple test and was able to do 10000 updates on 1000
> rows table in ~30s. That's practically enough but I'd like to have
> more room to slow down.

Is it 10000 *rows* or 10000*1000 = 10 000 000 *rows* updated ?

When I run a simple update 10 times on 1000 rows (with no trigger, which
you claim to take about the same time) it took 0.25 sec.

> Also best result I achieved by doing commit+vacuum every ~500
> updates.

It seems like you are updating more than one row at each update ?

---------------
Hannu




view thread (10+ messages)  latest in thread

Message-ID: <1063120683.6150.43.camel@fuji.krosing.net>
Permalink:  ../1063120683.6150.43.camel@fuji.krosing.net/
Also on:    postgresql.org/message-id/1063120683.6150.43.camel@fuji.krosing.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: hannu@tm.ee, mind@bi.lt
  Subject: Re: Need advice about triggers
  In-Reply-To: <1063120683.6150.43.camel@fuji.krosing.net>
  References: <00be01c376cf$91510620$f20214ac@bite.lt> <1063120683.6150.43.camel@fuji.krosing.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox