Re: New gist vacuum.

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Костя Кузнецов <chapaev28(at)ya(dot)ru>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: New gist vacuum.
Date: 2018-01-15 18:34:35
Message-ID: CAPpHfdt2DWPxnr780Lxc2_Vo75Bf7Y4LWM1t9KVhAEuX0SeAWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi!

On Sat, Dec 30, 2017 at 12:18 PM, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
wrote:

> > 28 дек. 2017 г., в 16:37, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
> написал(а):
> > Here is new version of the patch for GiST VACUUM.
> > There are two main changes:
> > 1. During rescan for page deletion only know to be recently empty pages
> are rescanned.
> > 2. I've re-implemented physical scan with array instead of hash table.
>
> There is one more minor spot in GiST VACUUM. It takes heap tuples count
> for statistics for partial indexes, while it should not.
>
> If gistvacuumcleanup() is not given a statistics gathered by
> gistbulkdelete() it returns incorrect tuples count for partial index.
> Here's the micropatch, which fixes that corner case.
> To reproduce this effect I used this query:
> create table y as select cube(random()) c from generate_series(1,10000) y;
> create index on y using gist(c) where c~>1 > 0.5;
> vacuum verbose y;
> Before patch it will report 10000 tuples, with patch it will report
> different values around 5000.
>

It's very good that you've fixed that.

I do not know, should I register separate commitfest entry? The code is
> very close to main GiST VACUUM patch, but solves a bit different problem.
>

Yes, I think it deserves separate commitfest entry. Despite it's related
to GiST VACUUM, it's a separate fix.
I've made small improvements to this patch: variable naming, formatting,
comments.
BTW, do we really need to set shouldCount depending on whether we receive
stats argument or not? What if we always set shouldCount as in the first
branch of "if"?

> shouldCount = !heap_attisnull(rel->rd_indextuple, Anum_pg_index_indpred) ||
> info->estimated_count;

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
0001-Count-tuples-correctly-during-GiST-VACUUM-of-partial-2.patch application/octet-stream 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2018-01-15 18:42:26 Re: New gist vacuum.
Previous Message Chapman Flack 2018-01-15 18:24:45 Re: proposal: alternative psql commands quit and exit