Re: Microvacuum support for Hash Index
Ashutosh Sharma <ashu.coek88@gmail.com>
From: Ashutosh Sharma <ashu.coek88@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Michael Paquier <michael.paquier@gmail.com>, Jesper Pedersen <jesper.pedersen@redhat.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-03-17T15:04:08Z
Lists: pgsql-hackers
Attachments
- 0001-Reset-LH_PAGE_HAS_DEAD_TUPLES-flag-during-replay-v4.patch (binary/octet-stream) patch v4-0001
On Fri, Mar 17, 2017 at 6:13 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Fri, Mar 17, 2017 at 12:27 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>> On Fri, Mar 17, 2017 at 8:20 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>>
>> As I said in my previous e-mail, I think you need
>>> to record clearing of this flag in WAL record XLOG_HASH_DELETE as you
>>> are not doing this unconditionally and then during replay clear it
>>> only when the WAL record indicates the same.
>>
>> Thank you so much for putting that point. I too think that we should
>> record the flag status in the WAL record and clear it only when
>> required during replay.
>>
>
> I think hashdesc.c needs an update (refer case XLOG_HASH_DELETE:).
Done. Thanks!
>
> - * flag. Clearing this flag is just a hint; replay won't redo this.
> + * flag. Clearing this flag is just a hint; replay will check the
> + * status of clear_dead_marking flag before redo it.
> */
> if (tuples_removed && *tuples_removed > 0 &&
> opaque->hasho_flag & LH_PAGE_HAS_DEAD_TUPLES)
> + {
> opaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES;
> + clear_dead_marking = true;
> + }
>
>
> I feel the above comment is not required as you are logging this
> action explicitly.
That's right. I have removed it in the attached v4 patch.
>
> + bool clear_dead_marking; /* TRUE if VACUUM clears
>
> No need to write VACUUM explicitly, you can simply say "TRUE if this
> operation clears ...".
Corrected. Please find the attached v4 patch.
--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com
Commits
-
Fixes for single-page hash index vacuum.
- 953477ca3526 10.0 landed
-
Port single-page btree vacuum logic to hash indexes.
- 6977b8b7f4df 10.0 landed
-
Avoid core dump for empty prepared statement in an aborted transaction.
- ba61a04bc7fe 10.0 cited
-
Change representation of statement lists, and add statement location info.
- ab1f0c822571 10.0 cited