Re: count(*) performance improvement ideas - Mailing list pgsql-hackers

From Tom Lane
Subject Re: count(*) performance improvement ideas
Date
Msg-id 5522.1208391659@sss.pgh.pa.us
Whole thread Raw
In response to Re: count(*) performance improvement ideas  ("Stephen Denne" <Stephen.Denne@datamail.co.nz>)
Responses Re: count(*) performance improvement ideas  ("Stephen Denne" <Stephen.Denne@datamail.co.nz>)
List pgsql-hackers
"Stephen Denne" <Stephen.Denne@datamail.co.nz> writes:
> Aside: It is currently more cumbersome to get a function to run, if needed, at commit. Ideal solution would be
somethinglike "EXECUTE ON COMMIT my_function()" or maybe "SAVEPOINT my_name ON COMMIT my_function()", but these
suggestionsare made without investigating what provision the SQL standard has made to address this need.
 

There is none, and the reason seems pretty obvious to me.  What if your
"on commit" function fails?  Or if you have two, and the second one
fails?  Or even more to the point, the second one does something that
the first one expected to see the effects of?

Transaction commit is an exceedingly subtle and carefully structured
thing.  Throwing random user-defined code into it ain't gonna happen.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Lessons from commit fest
Next
From: PFC
Date:
Subject: Re: count(*) performance improvement ideas