From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Dmitriy Sarafannikov <dsarafannikov(at)yandex(dot)ru> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Borodin Vladimir <root(at)simply(dot)name>, Хомик Кирилл <khomikki(at)yandex-team(dot)ru> |
Subject: | Re: [PROPOSAL] Use SnapshotAny in get_actual_variable_range |
Date: | 2017-05-05 07:49:57 |
Message-ID: | CAA4eK1Lt3_9FC9KypeysGjw2OXo+3JYXR73u0KFaSq7FpevhZQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, May 4, 2017 at 9:42 PM, Dmitriy Sarafannikov
<dsarafannikov(at)yandex(dot)ru> wrote:
>
>> Maybe we need another type of snapshot that would accept any
>> non-vacuumable tuple. I really don't want SnapshotAny semantics here,
>> but a tuple that was live more recently than the xmin horizon seems
>> like it's acceptable enough. HeapTupleSatisfiesVacuum already
>> implements the right behavior, but we don't have a Snapshot-style
>> interface for it.
>
>
> I have tried to implement this new type of snapshot that accepts any
> non-vacuumable tuples.
> We have tried this patch in our load environment. And it has smoothed out
> and reduced magnitude of the cpu usage peaks.
> But this snapshot does not solve the problem completely.
>
> Patch is attached.
1.
+#define InitNonVacuumableSnapshot(snapshotdata) \
+ do { \
+ (snapshotdata).satisfies = HeapTupleSatisfiesNonVacuumable; \
+ (snapshotdata).xmin = RecentGlobalDataXmin; \
+ } while(0)
+
Can you explain and add comments why you think RecentGlobalDataXmin is
the right to use it here? As of now, it seems to be only used for
pruning non-catalog tables.
2.
+bool
+HeapTupleSatisfiesNonVacuumable(HeapTuple htup, Snapshot snapshot,
+ Buffer buffer)
+{
+ return HeapTupleSatisfiesVacuum(htup, snapshot->xmin, buffer)
+ != HEAPTUPLE_DEAD;
+}
+
Add comments on top of this function and for the sake of consistency
update the file header as well (Summary of visibility functions:)
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Dmitriy Sarafannikov | 2017-05-05 07:58:48 | Re: [PROPOSAL] Use SnapshotAny in get_actual_variable_range |
Previous Message | Albe Laurenz | 2017-05-05 07:38:38 | Re: password_encryption, default and 'plain' support |