Re: GUC for cleanup indexes threshold.

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "Ideriha, Takeshi" <ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
Subject: Re: GUC for cleanup indexes threshold.
Date: 2017-02-24 20:16:16
Message-ID: 3ccae3e8-f3c3-e17f-a3e2-6cfe76b29fd8@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/24/17 11:26 AM, Robert Haas wrote:
> I think we need to come up with some set of tests to figure out what
> actually works well in practice here. Theories are a good starting
> point, but good vacuum behavior is really important, and a patch that
> changes it ought to be backed up by at least some experimental
> evidence.

I think something else worth considering is that if we had some method
of mapping heap TIDs back to indexes then a lot (all?) of these problems
would go away. 10+ years ago the idea of keeping such a mapping would
probably be untenable, but with resource forks and how much cheaper
storage is maybe that's no longer the case.

For btree I think this could be done by keeping a second btree ordered
by ctid that points either to index entries or even just to whole index
pages. At ~ 20 bytes per entry, even a 1B row index would take ~20GB.

Page splits are obviously a big issue. Maybe it's safe to update the
ctid map for every item that gets moved when a split happens.

Would a ctid map work for other indexes as well?
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-02-24 20:20:42 Re: FYI: git worktrees as replacement for "rsync the CVSROOT"
Previous Message Ants Aasma 2017-02-24 20:14:36 Re: Checksums by default?