I can see this function available in the backend:
TransactionId GetOldestXmin(bool alldbs);
The cost is based on walking thru each backend process, which I guess
is obvious, as if there are 47 backends, that means 47 xids.
Presumably not _too_ expensive; certainly something that has to be run
In an attempt to throw the authorities off his trail, Christopher Browne
<[EMAIL PROTECTED]> transmitted:
> It sure would be nice to be able to have a way to query the start
> time of the eldest transaction on the system.
I can see this function available in the backend:
TransactionId GetOlde
> [EMAIL PROTECTED] writes:
> pg_locks certainly seems like a better solution. Perhaps it didn't
> exist when you went with pg_stat_activity? Can't recall offhand.
Neither do I... But I do need something that will work with at least any
recent backend version--say, 7.2 or since. The more the
[EMAIL PROTECTED] writes:
> Tom, I believe you said at the time that I should check pg_stat_activity.
> My current code polls it for the old backend pid. But if that is neither
> 100% reliable nor unconditionally available, wouldn't it be better if I
> just queried pg_locks for the transaction's
Bruce Momjian wrote:
>> > You can get that from pg_stat_activity, if you have the relevant stats
>> > turned on.
>>
>> pg_stat_activity will tell you about the oldest active query, but not
>> about oldest open transaction.
>
> And pg_stat_activity can lose information when the network is under
> h
Tom Lane wrote:
> Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> >> It sure would be nice to be able to have a way to query the start time
> >> of the eldest transaction on the system. If that could be done at a
> >> not-too-high cost, it would be eminently helpful for various sorts of
> >>
On Thu, Feb 24, 2005 at 11:14:07AM -0500, Tom Lane wrote:
> Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> >> It sure would be nice to be able to have a way to query the start time
> >> of the eldest transaction on the system. If that could be done at a
> >> not-too-high cost, it would be e
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
>> It sure would be nice to be able to have a way to query the start time
>> of the eldest transaction on the system. If that could be done at a
>> not-too-high cost, it would be eminently helpful for various sorts of
>> maintenance processes so
It sure would be nice to be able to have a way to query the start time
of the eldest transaction on the system. If that could be done at a
not-too-high cost, it would be eminently helpful for various sorts of
maintenance processes so that you could assortedly:
You can get that from pg_stat_activit