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 1iEb6W-0008T9-Sb for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Sep 2019 15:27:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iEb6V-0006Hd-AX for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Sep 2019 15:27:19 +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 1iEb6U-0006Ds-R7 for pgsql-hackers@lists.postgresql.org; Sun, 29 Sep 2019 15:27:19 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEb6R-0003G1-7y for pgsql-hackers@postgresql.org; Sun, 29 Sep 2019 15:27:18 +0000 Received: by mail-qk1-x743.google.com with SMTP id q203so5661853qke.1 for ; Sun, 29 Sep 2019 08:27:14 -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=FeXvWQWxGnu0GSD/mqiQWt0G7xht/9imWSUYqyQPfrQ=; b=T/atM6YH3Vdm9WTbhzjaZINYdAEI7nVYMdoTXyT98/sdE9/ODZnCvvG5O+ohYVVopf Du+JPHVLYWnTliKzqMUALiMU0+rOxzY2ntjLecQWyrjdZpFhU802wjN5hyaj1nA5rRwr Gn7SfMbK3PBQI0B6uWEGXTlHd/UvGTl0Kb1KUiLToxAiSJPaj9JZSNFbxIOuIm4DW+po QCbxAJhSDuFTPl6T0Y+87wJysG+TUSZQuEyzGIBpzzDmJzJi8blAP4/r5ZEXgBP+jLQq dgi1AZ7ZZ7+j8eQahUMQSk/8eirLAXL0hXVRVG+rmwgq2+SSY7/6SG9P84H6eo7dEG/T 16hA== 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=FeXvWQWxGnu0GSD/mqiQWt0G7xht/9imWSUYqyQPfrQ=; b=uMTKEjee1fSbctgxJ8gLLkNJtyESHAxASTK7GhBOBoag1d7DsEmWZjwiSlpBp5dTQP nJqNePUmP3RpAcM3sk9HnQZ8wmM4es2r7cpRWJ3aOhMylnBSiKxvtqM+hSHSgTEVO+P1 RU4X6O7CJXSHX6dJpfMTL/D+ilZJJfTPAca+WCqSB8MehMQ5vw4wy+gt5+hZ2xsRdO8n UY0ci5Zsoed5K7od7Bd34WFLbg8dL5wG+8KsiQV+u1nx3tOR9M0MZcvwIsJfjNA+JJ6a CnYNZJVCLITFPwLDigF/0JIa83W5bLQ5O5zQegzz7QgXV9xPTTY/+TjIVWA6SDxePsmt EZaw== X-Gm-Message-State: APjAAAWQIHgwluoO6miXlFMW6oTbJtF5FBHP/pn58/1oRHs+luvnJIOb 6aq/JNyZFTUqorUJ/kqxnXUqJQ== X-Google-Smtp-Source: APXvYqy1ndQzjQtNuJYXVSfJXv8f7zvK5PslZWy7/0unYz8NGquPdlflC906S1liIy/sTZQPVk1W+g== X-Received: by 2002:ae9:dd84:: with SMTP id r126mr14858150qkf.339.1569770832398; Sun, 29 Sep 2019 08:27:12 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([201.186.209.84]) by smtp.gmail.com with ESMTPSA id s23sm6853608qte.72.2019.09.29.08.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2019 08:27:11 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 163F5120AD6; Sun, 29 Sep 2019 12:27:09 -0300 (-03) Date: Sun, 29 Sep 2019 12:27:09 -0300 From: Alvaro Herrera To: James Coleman Cc: Bruce Momjian , pgsql-hackers Subject: Re: [DOC] Document concurrent index builds waiting on each other Message-ID: <20190929152709.GA25027@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-Sep-28, James Coleman wrote: > I believe caveats like this are worth calling out rather than > expecting users to have to understand the implementation details an > work out the implications on their own. I agree. > I read Alvaro as referring to the fact that the docs already call out > the following: > > > Regular index builds permit other regular index builds on the same > > table to occur simultaneously, but only one concurrent index build > > can occur on a table at a time. Yeah, that's what I was understanding. BTW I think there's an approach that could alleviate part of this problem, at least some of the time: whenever CIC runs for an index that's not on expression and not partial, we could set the PROC_IN_VACUUM flag. That would cause it to get ignored by other processes for snapshot purposes (including CIC itself), as well as by vacuum. I need to take some time to research the safety of this, but intuitively it seems safe. Even further, I think we could also do it for regular CREATE INDEX (under the same conditions) provided that it's not run in a transaction block. But that requires even more research/proof. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services