RE: Wrong value in metapage of GIN INDEX.

From: "imai(dot)yoshikazu(at)fujitsu(dot)com" <imai(dot)yoshikazu(at)fujitsu(dot)com>
To: "'Moon, Insung'" <tsukiwamoon(dot)pgsql(at)gmail(dot)com>
Cc: "keisuke(dot)kuroda(dot)3862(at)gmail(dot)com" <keisuke(dot)kuroda(dot)3862(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Wrong value in metapage of GIN INDEX.
Date: 2019-10-08 06:46:10
Message-ID: OSAPR01MB4609CF4DD8BEEC07EDDAE190949A0@OSAPR01MB4609.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Nelson 2019-10-08 06:46:51 Re: Change atoi to strtol in same place
Previous Message Amit Kapila 2019-10-08 06:35:57 Re: Ordering of header file inclusion