Re: pgsql: Avoid creation of the free space map for small heap relations, t

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <akapila(at)postgresql(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Avoid creation of the free space map for small heap relations, t
Date: 2019-02-28 03:25:12
Message-ID: CAA4eK1KtE_6LaQSz+cq8Yp4TC_BySdVn9UmG0Wi_1EOpdobcWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Thu, Feb 28, 2019 at 8:10 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Thu, Feb 28, 2019 at 7:45 AM John Naylor <john(dot)naylor(at)2ndquadrant(dot)com> wrote:
> >
> > On Thu, Feb 28, 2019 at 7:24 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > > > The flaw in my thinking was treating extension too similarly too
> > > > finding an existing block. With your patch clearing the local map in
> > > > the correct place, it seems the call at hio.c:682 is now superfluous?
> > >
> > > What if get some valid block from the first call to
> > > GetPageWithFreeSpace via local map which has required space? I think
> > > in that case we will need the call at hio.c:682. Am I missing
> > > something?
> >
> > Are you referring to the call at line 393? Then the map will be
> > cleared on line 507 before we return that buffer.
> >
>
> That's correct, I haven't looked at line number very carefully and
> assumed that you are saying to remove the call at 507. I also think
> that the call at line 682 doesn't seem to be required, but I would
> prefer to keep it for the sake of consistency in this function and
> safety purpose. However, I think we should add a comment on the lines
> suggested by you. I will send the patch after making these
> modifications.
>

Here's an updated patch based on comments by you. I will proceed with
this unless you have any more comments.

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

Attachment Content-Type Size
fix_loc_map_clear_3.patch application/octet-stream 2.9 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2019-02-28 04:29:24 Re: pgsql: Avoid creation of the free space map for small heap relations, t
Previous Message Amit Kapila 2019-02-28 02:40:28 Re: pgsql: Avoid creation of the free space map for small heap relations, t

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-02-28 03:25:27 Re: psql display of foreign keys
Previous Message Mark Wong 2019-02-28 03:21:43 Re: A note about recent ecpg buildfarm failures