RE: Wrong value in metapage of GIN INDEX. - Mailing list pgsql-hackers

From imai.yoshikazu@fujitsu.com
Subject RE: Wrong value in metapage of GIN INDEX.
Date
Msg-id OSAPR01MB4609CF4DD8BEEC07EDDAE190949A0@OSAPR01MB4609.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Wrong value in metapage of GIN INDEX.  ("Moon, Insung" <tsukiwamoon.pgsql@gmail.com>)
Responses Re: Wrong value in metapage of GIN INDEX.
List pgsql-hackers
Moon-san, kuroda.keisuke-san

On Thu, Aug 29, 2019 at 8:20 AM, Moon, Insung wrote:
> =# CREATE INDEX foo_idx ON foo USING gin (i jsonb_ops);
> =# SELECT * FROM gin_metapage_info(get_raw_page('foo_idx', 0)) WITH (fastupdate=off);

This is not important thing but some mistakes are here.

=# CREATE INDEX foo_idx ON foo USING gin (i jsonb_ops) WITH (fastupdate=off);
=# SELECT * FROM gin_metapage_info(get_raw_page('foo_idx', 0));


> In this example, the nentries value should be 10001 because the gin index stores duplicate values in one
leaf(posting
> tree or posting list).
...
> The patch is very simple.
> Fix to increase the value of nEntries only when a non-duplicate GIN index leaf added.

Does nentries show the number of entries in the leaf pages?
If so, the fix seems to be correct.

--
Yoshikazu Imai

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Ordering of header file inclusion
Next
From: Joe Nelson
Date:
Subject: Re: Change atoi to strtol in same place