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 1hZKOs-0001Dl-DA for pgsql-general@arkaria.postgresql.org; Fri, 07 Jun 2019 19:19:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hZKNs-0008W6-2s for pgsql-general@arkaria.postgresql.org; Fri, 07 Jun 2019 19:18:40 +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 1hZKNr-0008Vy-MN for pgsql-general@lists.postgresql.org; Fri, 07 Jun 2019 19:18:39 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hZKNo-0007sU-NM for pgsql-general@lists.postgresql.org; Fri, 07 Jun 2019 19:18:38 +0000 Received: by mail-qt1-x841.google.com with SMTP id y57so3589280qtk.4 for ; Fri, 07 Jun 2019 12:18:36 -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=b6L0A5V1vjhsX1vmxq+DRiTi9ju/yW36rSJUHdMPPZs=; b=M0e3PtHEtTp/IGJCfQ8Blo8VwebItUaNeFD/JSVaF9ctD4AIESpEByj+M51GII9JQk HhUuvC/bxLuZxQTGxyhSHBWcKvBjeGA6Mz0/dEY6Iy/2kwfX0mo4IDX/d2SAY6gPDjE3 4SHQrBC5VjoBE/7LoFNR3Z/EhDUI8LkogsvIolyn1ZxrlrqEDArkeKykwtqs7ls1wAhJ n265p5hPZEOyc73GhSW3UOkop1dyZTldZiqX0dJfwkNQifbi4ASnY6idfqnW/I5tb1lw zgGjqgj+/g/79RHFfdCHiXI9fOowd3XShUXuPwIyKdAqhgOhIPOWOJg2fmLKQeBIzmpU kELQ== 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=b6L0A5V1vjhsX1vmxq+DRiTi9ju/yW36rSJUHdMPPZs=; b=EeC4VkUhh+HmISKEmxxbo3UnU6BKAqzMQIRS7YWt0B1U3i8TXbTkQR+RpXWHmVJFei wj4EuKpTA5N/+DeXfLr1+HQQ/eHetQ+fJTiKR03s5evX49k8zDypTpGJz0EewwkNEt1y tY5zV8h2bTRtU1oum494NxvOIrX48HsRJOJ4UATKbxJv1u4/TBc2APNyuAPz03ZVRv/H zclp6PFYxIzWmhk1ELJb40CobpckwwNUzfh6VmxbS2M+JhksmYPuom/OB5V5VqehHLjL e7CM5Z1K+s7B+F1cP2xWoCXvBJi5Vl4PwnN2AqEt2xTWGiarAvpmmcZ9Xj8c9gEN1gxZ qILg== X-Gm-Message-State: APjAAAUBBdvHJjvaepCd0HGs3thoehLfyQVXsN4awFG/aPo9FQi0dFs7 LPwR0UHKqWCG0vkLeCWtU9L2Zw== X-Google-Smtp-Source: APXvYqy79B78ly+t5BisIio0r1NDH64l/1B3DZ9rNp+elMh9gZQRxTgopR6YUAWTMiQaanVJlRueuQ== X-Received: by 2002:a0c:96aa:: with SMTP id a39mr46316596qvd.230.1559935115835; Fri, 07 Jun 2019 12:18:35 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([177.154.145.98]) by smtp.gmail.com with ESMTPSA id o22sm1494541qkk.50.2019.06.07.12.18.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jun 2019 12:18:35 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 729451207D8; Fri, 7 Jun 2019 15:18:32 -0400 (-04) Date: Fri, 7 Jun 2019 15:18:32 -0400 From: Alvaro Herrera To: Peter Geoghegan Cc: David Rowley , "Alex V." , pgsql-general , tgl Subject: Re: Table partition with primary key in 11.3 Message-ID: <20190607191832.GA23001@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-Jun-07, Peter Geoghegan wrote: > On Fri, Jun 7, 2019 at 9:10 AM Alvaro Herrera wrote: > > I think vacuuming for global indexes is somewhat challenging as well :-) > > Maybe not as much as for indirect indexes, that's true. > > > > In order for it to be sustainable, I think you'll want to reuse > > partition identifiers when the partitions are dropped/detached, which > > means that you need a way to ensure that index entries to those > > partitions are removed from all indexes. > > I'm not so sure about that. I see your point, but I think that you can > also make the opposite argument. That is, you can make a good case for > asynchronously cleaning up the dead entries that point to a dropped > partition (probably within VACUUM). Perhaps we should offer *both* as > options. I was thinking of asynchonously cleaning it up rather than blocking DROP/DETACH ... which means you need to keep state somewhere. I don't think blocking DROP/DETACH is valuable -- a global index that blocks DROP/DETACH until the index is clean serves no useful purpose. (You could think of a multi-step approach with internal transaction commits, similar to CIC, but you still need a plan to clean that up in case the server crashes during that operation.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services