Re: GiST VACUUM

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Robert Haas <robertmhaas@gmail.com>, Thomas Munro <thomas.munro@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Костя Кузнецов <chapaev28@ya.ru>
Date: 2018-07-19T11:20:51Z
Lists: pgsql-hackers
On 19/07/18 13:52, Andrey Borodin wrote:
> Hi!
> 
>> 19 июля 2018 г., в 1:12, Heikki Linnakangas <hlinnaka@iki.fi>
>> написал(а):
>> 
>> Yeah, please, I think this is the way to go.
> 
> Here's v11 divided into proposed steps.

Thanks, one quick question:

> 			/* We should not unlock buffer if we are going to jump left */
> 			if (needScan)
> 			{
> 				GistBDItem *ptr = (GistBDItem *) palloc(sizeof(GistBDItem));
> 				ptr->buffer = buffer;
> 				ptr->next = bufferStack;
> 				bufferStack = ptr;
> 			}
> 			else
> 				UnlockReleaseBuffer(buffer);

Why? I don't see any need to keep the page locked, when we "jump left".

- Heikki


Commits

  1. Use full 64-bit XID for checking if a deleted GiST page is old enough.

  2. Refactor checks for deleted GiST pages.

  3. Delete empty pages during GiST VACUUM.

  4. Scan GiST indexes in physical order during VACUUM.

  5. Prevent GIN deleted pages from being reclaimed too early