Re: Write Ahead Logging for Hash Indexes

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Write Ahead Logging for Hash Indexes
Date: 2017-02-10 06:45:38
Message-ID: CAA4eK1JiJs912aBvsxO1-phhJ==G7rvas4BgJMvBvATaZm_uxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 9, 2017 at 10:28 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Jan 12, 2017 at 10:23 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> On Fri, Jan 13, 2017 at 1:04 AM, Jesper Pedersen
>> <jesper(dot)pedersen(at)redhat(dot)com> wrote:
>>> On 12/27/2016 01:58 AM, Amit Kapila wrote:
>>>> After recent commit's 7819ba1e and 25216c98, this patch requires a
>>>> rebase. Attached is the rebased patch.
>>>
>>> This needs a rebase after commit e898437.
>>
>> Attached find the rebased patch.
>
> Well, I've managed to break this again by committing more things.
>

I have again rebased it, this time it requires few more changes due to
the previous commits. As we have to store hashm_maxbucket number in
prevblock number of primary bucket page, we need to take of same
during replay wherever applicable. Also, there were few new tests in
contrib modules which were failing. Attached patch is still a rebased
version of the previous patch, I will work on splitting it as per your
suggestion below, but I thought it is better to post the rebased patch
as well.

> I think it would be helpful if you broke this into a series of
> preliminary refactoring patches and then a final patch that actually
> adds WAL-logging.

Okay, that makes sense to me as well.

> The things that look like preliminary refactoring to
> me are:
>
> - Adding _hash_pgaddmultitup and using it in various places.
> - Adding and freeing overflow pages has been extensively reworked.
>

Freeing the overflow page is too tightly coupled with changes related
to _hash_pgaddmultitup, so it might be better to keep it along with
it. However, I think we can prepare a separate patch for changes
related to adding the overflow page.

> - Similarly, there is some refactoring of how bitmap pages get initialized.
> - Index initialization has been rejiggered significantly.
> - Bucket splits have been rejiggered.
>

Will try to prepare separate patches for the above three.

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

Attachment Content-Type Size
wal_hash_index_v9.patch application/octet-stream 131.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2017-02-10 06:58:09 Re: Partitioned tables and relfilenode
Previous Message Amit Langote 2017-02-10 06:19:47 Partitioned tables and relfilenode