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 1i4OKQ-0002bH-Ab for pgsql-bugs@arkaria.postgresql.org; Sun, 01 Sep 2019 11:47:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i4OKP-0006tU-7f for pgsql-bugs@arkaria.postgresql.org; Sun, 01 Sep 2019 11:47:29 +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 1i4NsY-0005JB-Qq for pgsql-bugs@lists.postgresql.org; Sun, 01 Sep 2019 11:18:42 +0000 Received: from sonic316-8.consmr.mail.gq1.yahoo.com ([98.137.69.32]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i4NsW-0006PY-DW for pgsql-bugs@lists.postgresql.org; Sun, 01 Sep 2019 11:18:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1567336718; bh=TMtvSrEmSpH7F/THRR8O+erElBrBd0335Gcmq7W5KfQ=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=CUMD9E/O7RdekISaZJsDdp7a+UlMslbBKpUJ1QU6hy1PijQL6m99EW0digT5jOukfAZzR7fPpUS//ANowK/3wvdYRVGPZSLGuoW7kaTbes/CYVemOhUL6dQaV9SkqO4hj7OqhPo8FDJpE6AcVE/OCxTXtuFFqGROm0cA9mbli5EOnDoTsnrM3QvGHRRaqtsKfVbpzN1Aq7w6bW3O8Wos+V5kvQFPI6JEz7JK5dWDJBwIy8GwlowDVTxRKdsRel+i6TrFYc20Aa/+5SkrHj3eRXqh62QfOoKxfj29HrYWupXinxg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vR2_86zW3SRuxv5ER.VTOGYSwwdmc.p2JR8k9 nel8RYEGeSi6vlotMEtfVYM7kM4z7M3kInucpNQcA6xf9CFEW_VSq2NVyXkyzVvohHK2tPJcCuaM U9FCH3fgaJNDGkDsBUcfAPSr2n8MLJlqBxPNVtj7ADTC37CFA7VR4jMceRQKzxLmffqsCY_UPqX8 AHgyhIncvaLZ23Ek60ibI89lH_RnmShNW2tiiySmGbvXp4sbhOw1ZKOQAF1EGPgTSgYrcoLAzkQc 8X0i1Js2m0lGlm53d4efzolD1V6kRvFqvBQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Sun, 1 Sep 2019 11:18:38 +0000 Date: Sun, 1 Sep 2019 11:18:33 +0000 (UTC) From: Jo Tzschenscher To: Michael Paquier , Fabien COELHO Cc: PostgreSQL Bugs Message-ID: <1437865225.1016949.1567336713777@mail.yahoo.com> In-Reply-To: References: <15987-7d85883d9674a15e@postgresql.org> <20190901043534.GA3190@paquier.xyz> Subject: Re: BUG #15987: Improve REINDEX of all indexes of a table at once MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1016948_919171353.1567336713776" X-Mailer: WebService/1.1.14303 YMailNorrin Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 Content-Length: 3155 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1016948_919171353.1567336713776 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Totally correct, Fabien! En domingo, 1 de septiembre de 2019 11:45:57 CEST, Fabien COELHO escribi=C3=B3: =20 =20 =20 >> one of the indexes. If the same columns occur in more than 1 index you n= eed >> to read them only once. Then you run 1 and only 1 full table scan (FTS),= and >> with the data of the cursor you add an entry into each of the indexes to >> rebuild. With just 1 FTS you could create all the indexes at once, and >> speeding up a full reindex task to use little more than the time the FTS >> takes. > > I don't quite understand your request.=C2=A0 You have REINDEX TABLE which > is able to reindex all the indexes of a table one by one, [=E2=80=A6] I understood the request as the scan should be factored out, so that=20 reindexing a table with multiple indexes would cost only one seq scan. --=20 Fabien. =20 ------=_Part_1016948_919171353.1567336713776 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Totally correct, Fabien!



=20
=20
En domingo, 1 de septiembre de 2019 11:45:57 CEST, Fabi= en COELHO <coelho@cri.ensmp.fr> escribi=C3=B3:




>&= gt; one of the indexes. If the same columns occur in more than 1 index you = need
>> to read them only once. Then you run 1 and = only 1 full table scan (FTS), and
>> with the data = of the cursor you add an entry into each of the indexes to
>> rebuild. With just 1 FTS you could create all the indexes at onc= e, and
>> speeding up a full reindex task to use li= ttle more than the time the FTS
>> takes.
>
> I don't quite understand your request= .  You have REINDEX TABLE which
> is able to rein= dex all the indexes of a table one by one, [=E2=80=A6]


I understood the request as the scan should be facto= red out, so that
reindexing a table with multiple indexe= s would cost only one seq scan.

-- Fabien.
------=_Part_1016948_919171353.1567336713776--