Re: WIP: Avoid creation of the free space map for small tables

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: Avoid creation of the free space map for small tables
Date: 2019-02-21 06:58:16
Message-ID: CAA4eK1L4ySv71_pg=kDeVqVkk9ijCoR_W+DgOiWLSX+4kbTqig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 11, 2019 at 10:48 PM John Naylor
<john(dot)naylor(at)2ndquadrant(dot)com> wrote:
>
> On 2/9/19, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > On Tue, Feb 5, 2019 at 3:25 PM John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>
> > wrote:
> >>
> >> On Tue, Feb 5, 2019 at 4:04 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> >> wrote:
> > This is certainly a good test w.r.t code coverage of new code, but I
> > have few comments:
> > 1. The size of records in test still depends on alignment (MAXALIGN).
> > Though it doesn't seem to be a problematic case, I still suggest we
> > can avoid using records whose size depends on alignment. If you
> > change the schema as CREATE TABLE fsm_check_size (num1 int, num2 int,
> > str text);, then you can avoid alignment related issues for the
> > records being used in test.
>
> Done.
>

Oops, on again carefully studying the test, I realized my above
comment was wrong. Let me explain with a test this time:
CREATE TABLE fsm_check_size (num int, str text);
INSERT INTO fsm_check_size SELECT i, rpad('', 1024, 'a') FROM
generate_series(1,3) i;

So here you are inserting 4-byte integer and 1024-bytes variable
length record. So the tuple length will be tuple_header (24-bytes) +
4-bytes for integer + 4-bytes header for variable length data + 1024
bytes of actual data. So, the length will be 1056 which is already
MAXALIGN. I took the new comments added in your latest version of the
patch and added them to the previous version of the patch. Kindly
see if I have not missed anything while merging the patch-versions?

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

Attachment Content-Type Size
v4-0001-Add-more-tests-for-FSM.patch application/octet-stream 5.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2019-02-21 07:05:55 Re: shared-memory based stats collector
Previous Message Nagaura, Ryohei 2019-02-21 06:51:16 RE: Timeout parameters