Re: Insert only table and size of GIN index JSONB field.

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Insert only table and size of GIN index JSONB field.
Дата
Msg-id CAMkU=1zp8HxHi0k32QKGpkJ2Z4H1++H8BeGuPkZzksUGTHdebQ@mail.gmail.com
обсуждение исходный текст
Ответ на Insert only table and size of GIN index JSONB field.  (Maxim Boguk <maxim.boguk@gmail.com>)
Ответы Re: Insert only table and size of GIN index JSONB field.  (Maxim Boguk <maxim.boguk@gmail.com>)
Список pgsql-general
On Tue, May 3, 2016 at 3:09 AM, Maxim Boguk <maxim.boguk@gmail.com> wrote:
> Hi,
>
> I started with empty table with index over
>  custom_fields | jsonb
> field
> defined as:
>     "idx_learners_custom_fields" gin (custom_fields)
> Globally gin_pending_list_limit set to 2MB.
> Database version is 9.5.2.
>
> Now question:
> If table populated with 1M records in single transaction then the final size
> of the GIN index is:
> 4265 MB
> but after I performed reindex index idx_learners_custom_fields;
> the index size had been reduced 15x to 295 MB.
>
> Is this behavior expected?

This sounds like a known issue, fixed in 9.6, where the pages used for
the pending list do not eligible for recycling until the table is
vacuumed.  Autovacuum does not run on insert only tables, so they just
accumulate as empty pages in the index.

Cheers,

Jeff


В списке pgsql-general по дате отправления:

Предыдущее
От: Evgeny Morozov
Дата:
Сообщение: Re: Allow disabling folding of unquoted identifiers to lowercase
Следующее
От: Steve Clark
Дата:
Сообщение: Get sum of sums