Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEtbp-0001Q6-DR for pgsql-general@arkaria.postgresql.org; Fri, 12 Apr 2019 10:40:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hEtbm-0006Ms-VC for pgsql-general@arkaria.postgresql.org; Fri, 12 Apr 2019 10:40:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEtbm-0006MI-0j for pgsql-general@lists.postgresql.org; Fri, 12 Apr 2019 10:40:34 +0000 Received: from smtp48.i.mail.ru ([94.100.177.108]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEtbd-0004tT-Pc for pgsql-general@postgresql.org; Fri, 12 Apr 2019 10:40:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=PYx5oN3JmIfO42uDV0JDQqnRdZ/tQsR7IrDAM3/INvI=; b=NeCHg7BBdvd8DLwy3etHvt6r16bl6p4yJDiiYSs0LXssyPqdTeHst3l9sk6171l4Nt4DaTzToxTOfJ/AKYSTBZExFtFsqILjnKzAMWYlKvbAvbaHGbmU2gDud/NAHzSjnoSC52SgZmLp8UHgYcnJTHJZrNPcCZ7szmeauBIapfQ=; Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1hEtbZ-0001ab-Ay; Fri, 12 Apr 2019 13:40:21 +0300 Subject: Re: When do vacuumed pages/tuples become available for reuse? To: Michael Lewis Cc: Jeff Janes , Tom Lane , pgsql-general General 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> <44a10837-648b-7cc9-d42a-146bc0c83574@mail.ru> <8aa21502-aed5-2114-dbb0-e2e03b7557eb@mail.ru> From: rihad Message-ID: <874426b2-2e1f-4896-3bd7-7cdc064fabe1@mail.ru> Date: Fri, 12 Apr 2019 14:40:17 +0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------F88286F982403FC99665DD31" Content-Language: en-US Authentication-Results: smtp48.i.mail.ru; auth=pass smtp.auth=rihad@mail.ru smtp.mailfrom=rihad@mail.ru X-77F55803: 0014004E1F3277295A78504BD2AC29416CDE1282D82D8196FBD03BDDB4D684CF56EA630D05C37AA638DC94B868B5BC67 X-7FA49CB5: 0D63561A33F958A58C724DDB3D915286FDAC24A51883E1289B4980C4BDA962508941B15DA834481FA18204E546F3947CEDCF5861DED71B2F389733CBF5DBD5E9C8A9BA7A39EFB7666BA297DBC24807EA117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC8364767815B9869FA544D8D32BA5DBAC0009BE9E8FC8737B5C2249668FBEE05F1161343AA81AA40904B5D9CF19DD082D7633A0BCA8734010DFDAB0D81D268191BDAD3D78DA827A17800CE79C648FADE979CBA9CD04E86FAF290E2D26E476CCD9869EB175ECD9A6C639B01B78DA827A17800CE751DBBB6FEEC465F8A6040B29ED131FE775ECD9A6C639B01B4E70A05D1297E1BBC6867C52282FAC8519DC0BE04022C72727F269C8F02392CD5571747095F342E88FB05168BE4CE3AF X-Mailru-Sender: B19AB4DAF1EA2FB5C266DE97D665ADA46DC4E317FF8CE26DADEDE43E39BD967ECF113DD4F50517E8ABBFE0CF075BC50BFB559BB5D741EB96004FA9CEFBA991DA3A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------F88286F982403FC99665DD31 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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? --------------F88286F982403FC99665DD31 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
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?

--------------F88286F982403FC99665DD31--