pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rihad <rihad@mail.ru>
To: Michael Lewis <mlewis@entrata.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: When do vacuumed pages/tuples become available for reuse?
Date: Fri, 12 Apr 2019 14:40:17 +0400
Message-ID: <874426b2-2e1f-4896-3bd7-7cdc064fabe1@mail.ru> (raw)
In-Reply-To: <CAHOFxGph35T4z-gHTksNiK=hLBUvr0dF_B_PDpVA9-bnyYfs2g@mail.gmail.com>
References: <9cd73fcb-511d-ede9-6789-209b7d4eb193@mail.ru>
	<8560.1554990486@sss.pgh.pa.us>
	<0522481c-4cf6-1928-8780-9bfa2d7c6aca@mail.ru>
	<9914.1554992415@sss.pgh.pa.us>
	<17dafb0f-5ab9-390e-96b0-2280d654f790@mail.ru>
	<CAMkU=1wZ1jSDKOqR+KVoDXUT7yprWqMZD-Rv-x__q3i-URkHQw@mail.gmail.com>
	<c7d435c1-a6f6-d570-1698-b8791161d406@mail.ru>
	<CAMkU=1z+-o0F5PSsjhN8P98+YrYgg7odTZ+WZvocBObY-LnZLA@mail.gmail.com>
	<44a10837-648b-7cc9-d42a-146bc0c83574@mail.ru>
	<CAMkU=1wNZrKVK9Jy0jWqBtuEN=_rHBrfZ6iA3eKgk0DTm=igkA@mail.gmail.com>
	<8aa21502-aed5-2114-dbb0-e2e03b7557eb@mail.ru>
	<CAHOFxGph35T4z-gHTksNiK=hLBUvr0dF_B_PDpVA9-bnyYfs2g@mail.gmail.com>

On 04/12/2019 08:39 AM, Michael Lewis wrote:
>
>     Way to many indexes. I'm going to have a hard time convincing our
>     programmers to get rid of any of them )
>
>
> You can create (concurrently) an identical index with a new name, then 
> drop old version concurrently and repeat for each. It doesn't help you 
> figure out the root cause and how to prevent it from happening again, 
> but gets you to a fresh start at least.

Thanks for the tip. I believe other than increasing load temporarily 
creating a new index, dropping the old one and renaming the new one to 
the old one are transparent and (almost) lock-less operations? What 
would happen to user queries during DROP INDEX? Would they block on it, 
or, being unable to read it without blocking, will they pick the new one 
based on the same column(s)? And, likewise, is ALTER INDEX ... RENAME 
... an instant operation, I hope?

view thread (30+ messages)

Message-ID: <874426b2-2e1f-4896-3bd7-7cdc064fabe1@mail.ru>
Permalink:  ../874426b2-2e1f-4896-3bd7-7cdc064fabe1@mail.ru/
Also on:    postgresql.org/message-id/874426b2-2e1f-4896-3bd7-7cdc064fabe1@mail.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: rihad@mail.ru, mlewis@entrata.com, jeff.janes@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: When do vacuumed pages/tuples become available for reuse?
  In-Reply-To: <874426b2-2e1f-4896-3bd7-7cdc064fabe1@mail.ru>
  References: <9cd73fcb-511d-ede9-6789-209b7d4eb193@mail.ru> <8560.1554990486@sss.pgh.pa.us> <0522481c-4cf6-1928-8780-9bfa2d7c6aca@mail.ru> <9914.1554992415@sss.pgh.pa.us> <17dafb0f-5ab9-390e-96b0-2280d654f790@mail.ru> <CAMkU=1wZ1jSDKOqR+KVoDXUT7yprWqMZD-Rv-x__q3i-URkHQw@mail.gmail.com> <c7d435c1-a6f6-d570-1698-b8791161d406@mail.ru> <CAMkU=1z+-o0F5PSsjhN8P98+YrYgg7odTZ+WZvocBObY-LnZLA@mail.gmail.com> <44a10837-648b-7cc9-d42a-146bc0c83574@mail.ru> <CAMkU=1wNZrKVK9Jy0jWqBtuEN=_rHBrfZ6iA3eKgk0DTm=igkA@mail.gmail.com> <8aa21502-aed5-2114-dbb0-e2e03b7557eb@mail.ru> <CAHOFxGph35T4z-gHTksNiK=hLBUvr0dF_B_PDpVA9-bnyYfs2g@mail.gmail.com> <874426b2-2e1f-4896-3bd7-7cdc064fabe1@mail.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox