Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPWml-0001jd-Qv for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Oct 2020 20:08:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPWmk-0007fJ-P2 for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Oct 2020 20:08:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPWmk-0007fC-Ig for pgsql-hackers@lists.postgresql.org; Mon, 05 Oct 2020 20:08:38 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kPWmi-0007uh-BW for pgsql-hackers@lists.postgresql.org; Mon, 05 Oct 2020 20:08:38 +0000 Received: by mail-il1-x142.google.com with SMTP id o18so4108339ill.2 for ; Mon, 05 Oct 2020 13:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=i87UtP+ZwkIZxmBD7XSd7bv0gyPF+Bt5AibSoE3PrdE=; b=lRSDpOVFc5O5lGDa6B0S0QxulWE62bD+GqhP4i7nLoQvBNs4sTpjX0u3PlZzRwXYUD wjVTjtIxKopqLVKmlu2bFW9pzpbYL5VvnIz30IZ5jK+VOIwXI+wUtNWDJHur+zWlEQBi oIKQANW/rNAAIlJVoPdEuNXKf0c/4AhhMH9Z4t5aNOT19jNGHSon8dAyqtaGxM/pTHU+ f0sud1c+jevdYFSzfGzg6RTM/yr6DYWlT7xtTrqB765/4PQcmvEvl1hUChR/hwhdwHFy 9w0zWDaVYQpa+KIcVcaplh8R3nO5tkFc3WdZa8+Rw2Qi6tKpAb/NSNPeNA5wnjyNrbSB 9Ekw== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=i87UtP+ZwkIZxmBD7XSd7bv0gyPF+Bt5AibSoE3PrdE=; b=bnvnkUla/ylsOMF0tRjkiIDQWDLPyErjFK8vTDzGWh+czB2dIJpVRL1yUH59z/Wked OsdlbCz7IQWF1oMVWx1v0jLzUkxr3bpcQVeiiKPM/b+q5g9tN8D2y7CYB3aYdQczISbh ObN7W9oLpjWXI1NlVAqXFTig5zT27K/668+dRfOHn4BdSN0TrFWQKznFVHjNhZHIBZdB 6fdKJlADKjkp0FZmVZOC95ojmSPzKxD91BxZxgjuR3g69pTZSpd0s7N5nvzDqkuKw9YH V56EiWAZMADNQSMBmZg2nVfIYVlN+gUXLC3Hk6iZgvjAyhVIW19IhyJoUJwTY+KQDjmo bqCQ== X-Gm-Message-State: AOAM532d1DJQAIum9gnQXObL1Is8ifBYsMz0ulVsQMHZIhm41J6W90wi GI9d2a6AZerhkTRwW8aiGci2pQ== X-Google-Smtp-Source: ABdhPJzCeh/mROXpvDEiNRmbLs0scCAUJmzKAwJH4jT093WIiv4pm+nwgWczFG4biTHJ/fRDCENVHQ== X-Received: by 2002:a92:8452:: with SMTP id l79mr782572ild.222.1601928514547; Mon, 05 Oct 2020 13:08:34 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id z200sm435091iof.47.2020.10.05.13.08.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2020 13:08:33 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id C2922800740; Mon, 5 Oct 2020 15:08:32 -0500 (CDT) Date: Mon, 5 Oct 2020 15:08:32 -0500 From: Justin Pryzby To: Michael Paquier Cc: =?utf-8?B?5p2O5p2wKOaFjui/vSk=?= , pgsql-hackers , =?utf-8?B?5pu+5paH5peMKOS5ieS7jik=?= , Alvaro Herrera Subject: Re: =?utf-8?B?5Zue5aSN77yaaG8=?= =?utf-8?Q?w?= to create index concurrently on partitioned table Message-ID: <20201005200832.GF17626@telsasoft.com> References: <20200809234423.GH20473@telsasoft.com> <20200901055158.GH3511@paquier.xyz> <20200908023915.GD7158@telsasoft.com> <20200908043105.GE19261@paquier.xyz> <20200912001301.GQ18552@telsasoft.com> <20200912013239.GA8636@paquier.xyz> <20200914143102.GX18552@telsasoft.com> <20200924081103.GS28585@paquier.xyz> <20200926195655.GA13816@telsasoft.com> <20201005084627.GI1464@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201005084627.GI1464@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 Mon, Oct 05, 2020 at 05:46:27PM +0900, Michael Paquier wrote: > On Sat, Sep 26, 2020 at 02:56:55PM -0500, Justin Pryzby wrote: > > Also, if a partitioned index is clustered, when we clear indisclustered for > > other indexes, should we also propogate that to their parent indexes, if any ? > > I am not sure what you mean here. Each partition's cluster runs in > its own individual transaction based on the patch you sent. Are you > suggesting to update indisclustered for the partitioned index of a > partitioned table and all its parent partitioned in the same > transaction, aka a transaction working on the partitioned table? No, I mean that if a partition is no longer clustered on some index, then its parent isn't clustered on that indexes parent, either. It means that we might do N catalog updates for a partition heirarchy that's N levels deep. Normally, N=2, and we'd clear indisclustered for the index as well as its parent. This is not essential, though. > >> It would be good also to check if > >> we have a partition index tree that maps partially with a partition > >> table tree (aka no all table partitions have a partition index), where > >> these don't get clustered because there is no index to work on. > > > > This should not happen, since a incomplete partitioned index is "invalid". > > Indeed, I did not know this property. I think that's something we can apply for CIC/DIC, too. It's not essential to avoid leaving an "invalid" or partial index if interrupted. It's only essential that a partial, partitioned index is not "valid". For DROP IND CONCURRENTLY, I wrote: On Mon, Sep 14, 2020 at 09:31:03AM -0500, Justin Pryzby wrote: > 2. Maybe the easiest way is to mark all indexes invalid and then drop all > partitions (concurrently) and then the partitioned parent. If interrupted, > this would leave a parent index marked "invalid", and some child tables with no > indexes. I think this may be "ok". The same thing is possible if a concurrent > build is interrupted, right ? -- Justin