From: | Manfred Koizar <mkoi-pg(at)aon(dot)at> |
---|---|
To: | Christian Mock <cm(at)coretec(dot)at> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: performance with triggers depends on table size? |
Date: | 2002-08-14 20:05:00 |
Message-ID: | vpcllucv5ka7gp1keg4jmqc6rpbf4i6964@4ax.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, 14 Aug 2002 19:53:19 +0200, Christian Mock <cm(at)coretec(dot)at>
wrote:
>Where's the big number of "Deleted" tuples coming from?
>From repeatedly
> UPDATE event_stats SET count = count + x_count
> WHERE stat_id = result.stat_id;
Due to MVCC Postgres treats an UPDATE much like a DELETE and an
INSERT. I suspect the deleted tuples get in the way, when the UNIQUE
constraint is checked. This explains the linear increase of time per
tuple. I guess you are inserting sorted by (c1, c2, c3) - or at least
in large chunks of equal (c1, c2, c3) - and the "drops" in your
diagram occur whenever (c1, c2, c3) - or whatever the unique columns
on event_stats are - changes.
For now you have already found a solution/workaround. In 7.3 this can
be expected to work better.
Servus
Manfred
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Jenkins | 2002-08-14 20:05:08 | Re: PG 7.2.1 core dump |
Previous Message | Tom Jenkins | 2002-08-14 19:58:12 | PG 7.2.1 core dump |