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 1iENv7-0001Sh-UG for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Sep 2019 01:22: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 1iENv5-00032C-0j for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Sep 2019 01:22:39 +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 1iENv4-00031Q-Jj for pgsql-hackers@lists.postgresql.org; Sun, 29 Sep 2019 01:22:38 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iENv0-000083-Sy for pgsql-hackers@postgresql.org; Sun, 29 Sep 2019 01:22:37 +0000 Received: by mail-qt1-x843.google.com with SMTP id f7so12271010qtq.7 for ; Sat, 28 Sep 2019 18:22:33 -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=vb7SWcpIyhGsNH5N5/fvmPWgcupOrXDoWJOud3G1GZM=; b=0VYh2UsjNMwOfR24eElqhLOEtzM6TZF4PIcmAlcaHn9+bwHnrPwe8nrvacKWKC+WbG ybnH7nh36Rm22Hqqdif8w5EQgyhMUFZsSI/PH8b8fEwXrcLgPy7NJlNphZGr94ARfWFQ gLgdD3hjUbwjvnpMHH5Lpv2m7JlAPvHaV+OtvbEi6NyN1HXagHhRhFy8CKBiZDFVKZhy 0afupLCzEtpdbYOZe/sLX4yXr4W8lLPfi96tCzPXJ0BRFYQ7Kk+EoLJ4jRTmp5O4MKmL kcYDPxH34c7AEJ277EwKCkXC74S15v3Sg4D4QrOrG/56cy7JjIPCZ43oEipi1KT+dFFq VL5Q== 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=vb7SWcpIyhGsNH5N5/fvmPWgcupOrXDoWJOud3G1GZM=; b=NPC5drJgd1JcPKnpJVFm0TiDCzp6IMz0EVIooQGwupG3PkAlWX0UIA/wqqUlvYRcqD B13v21njlPkfh3P52VhvrmK7GfJQpHg6oLlsw6ci3b/c9d/SMhg6V1P5+K5rJQ1P4dKM IzADao8GE3yg5j2LWDdqZQyoNG0izNbxnJtZYtYqwZWIIgHv1wms12+zj3dWcOwevHss 7Xusbai/qaz4cfPFMWkVuGeHogxcvaVKKohgL0ePwBi1Uw2Ut3btCdt1VuwcC67hRFWP B2NiDcGu87vbEGIATodPe+Nc8F17AryODQ3k/JdQerNxuWP6j5dPs+wN96R57ElMf8kc aatg== X-Gm-Message-State: APjAAAWdt+Tr4RsEGsVyz2qRwumKXvqoUv/glLqiIhewNwZwwgOqpDnn CsPm4XyNiKtmv1fUtskNb9Mt8A== X-Google-Smtp-Source: APXvYqxqLNo9VDQ15pbSHze3pfsnOsiCb+tbgIc83SVbVknhJjOPn/olMGF83K1hGCSaGUEOc88beg== X-Received: by 2002:ac8:444f:: with SMTP id m15mr18328793qtn.110.1569720151122; Sat, 28 Sep 2019 18:22:31 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([201.186.209.84]) by smtp.gmail.com with ESMTPSA id p77sm3712662qke.6.2019.09.28.18.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2019 18:22:30 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0332112076E; Sat, 28 Sep 2019 22:22:28 -0300 (-03) Date: Sat, 28 Sep 2019 22:22:28 -0300 From: Alvaro Herrera To: Bruce Momjian Cc: James Coleman , pgsql-hackers Subject: Re: [DOC] Document concurrent index builds waiting on each other Message-ID: <20190929012228.GA21412@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190928161838.GD26853@momjian.us> 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, Bruce Momjian wrote: > The CREATE INDEX docs already say: > > In a concurrent index build, the index is actually entered into > the system catalogs in one transaction, then two table scans occur in > two more transactions. Before each table scan, the index build must > wait for existing transactions that have modified the table to terminate. > After the second scan, the index build must wait for any transactions > --> that have a snapshot (see ) predating the second > --> scan to terminate. Then finally the index can be marked ready for use, > > So, having multiple concurrent index scans is just a special case of > having to "wait for any transactions that have a snapshot", no? I am > not sure adding a doc mention of other index builds really is helpful. I always thought that create index concurrently was prevented from running concurrently in a table by the ShareUpdateExclusive lock that's held during the operation. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services