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

From Tom Lane
Subject Re: count(*) performance improvement ideas
Date
Msg-id 20299.1208310958@sss.pgh.pa.us
Whole thread Raw
In response to Re: count(*) performance improvement ideas  ("Stephen Denne" <Stephen.Denne@datamail.co.nz>)
List pgsql-hackers
"Stephen Denne" <Stephen.Denne@datamail.co.nz> writes:
> The custom variable class can also be used to aggregate the deltas within a transaction, though there are some minor
difficulties:

> 1) They only store text
> 2) You can only find out that a value has not been set by catching an exception
> 3) There is no way to list the settings.

As for 2) and 3), can't you look into the pg_settings view?

> The time to create them for the first time for a connection seems to
vary a bit, between 200 and 1000 per minute.

Yeah, that path is not optimized at all because it was never considered
performance-critical.  Updating an existing variable should be cheaper.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Stephen Denne"
Date:
Subject: Re: count(*) performance improvement ideas
Next
From: "Stephen Denne"
Date:
Subject: Re: count(*) performance improvement ideas