Re: Maintaining a counter up-to-date

From: Samuel Tardieu <sam(at)rfc1149(dot)net>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Maintaining a counter up-to-date
Date: 2003-06-02 18:29:28
Message-ID: 2003-06-02-20-29-28+trackit+sam@rfc1149.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2/06, Richard Huxton wrote:

| You want to use triggers not rules here (see the "server programming" and
| "procedural language" manual sections). A trigger will be fired for each row
| inserted/deleted/updated. Of course this means it will be fired 5000 times
| for 5000 updated rows.

Ouch. At the current time, I reverted to count(*) style which seems to be
performed in much less time in 7.3.2 than in 7.2.x.

I'll look at the triggers, thanks.

Sam

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-06-02 22:49:33 Change owner of function in 7.2.4?
Previous Message Richard Huxton 2003-06-02 18:27:58 Re: Maintaining a counter up-to-date