Re: Much Ado About COUNT(*) - Mailing list pgsql-hackers

From D'Arcy J.M. Cain
Subject Re: Much Ado About COUNT(*)
Date
Msg-id 20050120065500.5344da8a.darcy@druid.net
Whole thread Raw
In response to Re: Much Ado About COUNT(*)  ("Mark Cave-Ayland" <m.cave-ayland@webbased.co.uk>)
Responses Re: Much Ado About COUNT(*)
List pgsql-hackers
On Thu, 20 Jan 2005 10:12:17 -0000
"Mark Cave-Ayland" <m.cave-ayland@webbased.co.uk> wrote:
> Thanks for the information. I seem to remember something similar to
> this being discussed last year in a similar thread. My only real issue
> I can see with this approach is that the trigger is fired for every
> row, and it is likely that the database I am planning will have large
> inserts of several hundred thousand records. Normally the impact of
> these is minimised by inserting the entire set in one transaction. Is
> there any way that your trigger can be modified to fire once per
> transaction with the number of modified rows as a parameter?

I don't believe that such a facility exists but before dismissing it you
should test it out.  I think that you will find that disk buffering (the
system's as well as PostgreSQL's) will effectively handle this for you
anyway.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: "Mark Cave-Ayland"
Date:
Subject: Re: Much Ado About COUNT(*)
Next
From: Neil Conway
Date:
Subject: Re: ARC patent