Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range
Date
Msg-id CAA4eK1K6c=B3E_JoS+WafiiJiA2g-rKab4Y5nyB+j=7jiMH_RA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range  (Dmitriy Sarafannikov <dsarafannikov@yandex.ru>)
Responses Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range  (Dmitriy Sarafannikov <dsarafannikov@yandex.ru>)
List pgsql-hackers
On Mon, May 8, 2017 at 6:30 PM, Dmitriy Sarafannikov
<dsarafannikov@yandex.ru> wrote:
>
> I think we can use RecentGlobalDataXmin for non-catalog relations and
> RecentGlobalXmin for catalog relations (probably a check similar to
> what we have in heap_page_prune_opt).
>
>
> I took check from heap_page_prune_opt (Maybe this check must be present as
> separate function?)
> But it requires to initialize snapshot for specific relation.
>

+ else \
+ (snapshotdata).xmin = \
+ TransactionIdLimitedForOldSnapshots(RecentGlobalDataXmin, \
+ relation); \

I think we don't need to use TransactionIdLimitedForOldSnapshots() as
that is required to override xmin for table vacuum/pruning purposes.

> Maybe we need
> to use GetOldestXmin()?

It is a costly call as it needs ProcArrayLock, so I don't think it
makes sense to use it here.


-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Atomics for heap_parallelscan_nextpage()
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] PG 10 release notes