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 1hEa5U-0005ou-F6 for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Apr 2019 13:49:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hEa5T-0007PN-6i for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Apr 2019 13:49:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEa5S-0007PG-UZ for pgsql-hackers@lists.postgresql.org; Thu, 11 Apr 2019 13:49:54 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEa5Q-0005wM-0w for pgsql-hackers@lists.postgresql.org; Thu, 11 Apr 2019 13:49:54 +0000 Received: by mail-qk1-x744.google.com with SMTP id n68so3483677qka.1 for ; Thu, 11 Apr 2019 06:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ARDMjXBBR5GXfNM2feleQT73F9LGVDK9PxiMzz28Vr0=; b=M70uLFezizvhvGCb56InbVnh5GHt2wNK7ayf92lwXAyg5Win1peLmvFjcqwf2EDnAj c5xDBPZEPRJto/Ubv640BIWsm59571a0R261ZgAO3/wCyrv77Vjv9+N+/0KUsWXNdQ4H QEOhPfu+BDW1zDliK9puHnKRIymNAlBMympgyFhOjRxzPI8RnFEb5tyCWDtrqhVVtk2a 0YlZLQzL0yXQGOMOHt9J7ae26+rl/NwzIXSZIJqjDzKS0lDtexNJ1kOLKevsGfxqGzn7 MgrjIOc8IweStfRApGpZZBhAqkfnJKLo1rz7/gsJJ1JK0doXEjK4irDSCDC7guGIV9/P 25VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=ARDMjXBBR5GXfNM2feleQT73F9LGVDK9PxiMzz28Vr0=; b=MU4SIKYZuNzYrekI6Do7qrqaFS5U0rAjbJwqb9gKFAd8sBRxs5+5PqQqnfNAQads/C Eznwd6zBlgLJbLtvFTrcaAmG6XKpeQj8zbgT0Of7OaSDGzmt4/Q4Zi7ADMfjZ2oU84cX j6PlQJuy2va1deh3NhEw+KCzwcii11tGU+rrsnOwmf3WhAHwj1phnGp5g0QH6w9VXbxZ H3g9UhW1e+ktWZWH6YEq3F3S/iWn01tt1WoQEzJkD8LCnA86UIesiWajdRU1smOHuNZv ScZH5iaqC4XfoLigMYpv9pghu0TUq9zz4XkUJN5xm7VGAPE5aGQlliSCpAYb/eqm5RWL F8Sg== X-Gm-Message-State: APjAAAX4C1VNVvFCeULQgGAZBmZXQHWAWx5R78qzs8OYMAanON5XlTak oPkPJ0vu5d00h+LvtMdpxSgEZA== X-Google-Smtp-Source: APXvYqwbPBZZ0biqzEL+JdWA0mFccEo64sfiAl7qSogU7ibC9XHgtTrpzQS9L415aRgHSuJjudNhAw== X-Received: by 2002:a05:620a:11:: with SMTP id j17mr39293872qki.111.1554990589991; Thu, 11 Apr 2019 06:49:49 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id c207sm21475295qkg.14.2019.04.11.06.49.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2019 06:49:49 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 7AB86120FBE; Thu, 11 Apr 2019 09:49:47 -0400 (-04) Date: Thu, 11 Apr 2019 09:49:47 -0400 From: Alvaro Herrera To: Michael Paquier Cc: Dagfinn Ilmari =?iso-8859-1?Q?Manns=E5ker?= , Peter Eisentraut , Sergei Kornilov , "pgsql-hackers@lists.postgresql.org" Subject: Re: REINDEX CONCURRENTLY 2.0 Message-ID: <20190411134947.GA22043@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190411132704.GC30766@paquier.xyz> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Apr-11, Michael Paquier wrote: > > I was going to just remove the caveat, but then I discovered that > > REINDEX CONCURRENTLY doesn't work on INVALID indexes (why?). > > This is a wanted choice. The index built in parallel of the existing > one during a concurrent reindex is marked invalid during most of the > operation. Hence, if the reindex is interrupted or fails, you finish > with potentially twice the number of original indexes, half being > invalid and the other half being the ones in use. If the user decides > to rinse and repeat the concurrent reindex, and if we were to also > select invalid indexes for the operation, then you would finish by > potentially doing twice the amount of work when working on a relation, > half of it for nothing. Hmm, I suppose that makes sense for REINDEX TABLE or anything that reindexes more than one index, but if you do REINDEX INDEX surely it is reasonable to allow the case? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services