Re: GiST VACUUM

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Heikki Linnakangas <hlinnaka@iki.fi>
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:42:06Z
Lists: pgsql-hackers

Attachments

<br />19.07.2018, 15:20, "Heikki Linnakangas" &lt;hlinnaka@iki.fi&gt;:<br /><blockquote type="cite"><p>On 19/07/18 13:52, Andrey Borodin wrote:<br /></p><blockquote> Hi!<br /><br /><blockquote> 19 июля 2018 г., в 1:12, Heikki Linnakangas &lt;<a href="mailto:hlinnaka@iki.fi">hlinnaka@iki.fi</a>&gt;<br /> написал(а):<br /><br /> Yeah, please, I think this is the way to go.<br /></blockquote><br /> Here's v11 divided into proposed steps.<br /></blockquote><p><br />Thanks, one quick question:<br /><br /></p><blockquote>                         /* We should not unlock buffer if we are going to jump left */<br />                         if (needScan)<br />                         {<br />                                 GistBDItem *ptr = (GistBDItem *) palloc(sizeof(GistBDItem));<br />                                 ptr-&gt;buffer = buffer;<br />                                 ptr-&gt;next = bufferStack;<br />                                 bufferStack = ptr;<br />                         }<br />                         else<br />                                 UnlockReleaseBuffer(buffer);<br /></blockquote><p><br />Why? I don't see any need to keep the page locked, when we "jump left".</p></blockquote><div>Because it can split to the left again, given that we release lock.</div><div><br /></div><div>Best regards, Andrey Borodin.</div>

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