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

From: John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(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-27 05:37:41
Message-ID: CACPNZCsZuKCXvyhrEuRWB1bTwF=jF+=xF3nLf_0O9tKmVN8iJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Feb 27, 2019 at 5:06 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> I have tried this test many times (more than 1000 times) by varying
> thread count, but couldn't reproduce it. My colleague, Kuntal has
> tried a similar test overnight, but the issue didn't reproduce which
> is not surprising to me seeing the nature of the problem. As I could
> reproduce it via the debugger, I think we can go ahead with the fix.
> I have improved the comments in the attached patch and I have also
> tried to address Tom's concern w.r.t comments by adding additional
> comments atop of data-structure used to maintain the local map.

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?
It wasn't sufficient before, so should this call be removed so as not
to mislead? Or maybe keep it to be safe, with a comment like "This
should already be cleared by now, but make sure it is."

+ * To maintain good performance, we only mark every other page as available
+ * in this map.

I think this implementation detail is not needed to comment on the
struct. I think the pointer to the README is sufficient.

--
John Naylor https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2019-02-27 06:22:31 Re: pgsql: Use slots in trigger infrastructure, except for the actual invoc
Previous Message Michael Paquier 2019-02-27 05:21:40 pgsql: Fix memory leak when inserting tuple at relation creation for CT

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-02-27 05:42:38 Re: TupleTableSlot abstraction
Previous Message Markus Winand 2019-02-27 05:36:43 Re: Index INCLUDE vs. Bitmap Index Scan