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 1hCQL9-0007gY-PQ for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2019 15:01:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hCQL7-0001N9-Uq for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2019 15:01:09 +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 1hCQL7-0001N1-J7 for pgsql-hackers@lists.postgresql.org; Fri, 05 Apr 2019 15:01:09 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCQL4-0004EJ-U0 for pgsql-hackers@lists.postgresql.org; Fri, 05 Apr 2019 15:01:08 +0000 Received: by mail-qt1-x844.google.com with SMTP id d13so7729768qth.5 for ; Fri, 05 Apr 2019 08:01:06 -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=WXZqT6RfUySZiaZ7ZT6BLPNhzJGKTJBt+Nfv17ZotyY=; b=lD8iMeps3Uedh5pz1MC6cgW9GMH77y4Y3hAeilFam1qabrPNR3IuE0+he4Yq6GE74m /5NVnAOM3QTeo22Mb3MuUe9tzcv7dXlSKp2ofPY9/3FFiDRd0/nzg31+IIx4qIPLyB0o PsfE4rRJ2W+acs8wmoBleMnQVfplKiPzwh1q7Q4LpA83tqThs6RfX9RfTDQ/0LahmaWm e1/RLrkcrJ4PMWhd/P/bj0rrf+zWMRP7N1OB5Wz8Y8olk84tWNEQJQ8r6prBOkv7Ch++ rWlx0dCPf+FawOQQk4+N2Kmx/tf195kq+CxA78m0vGTpvvfOE/rH9e/EP1HwQZIM8fPf 9/qg== 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=WXZqT6RfUySZiaZ7ZT6BLPNhzJGKTJBt+Nfv17ZotyY=; b=rHrqMsHIAIaNbRHuW6zsMw3GXFBeTL7OTPOm+hapqhYoa3DxOenUSBN/FX6QM0fYDV OmW2Ko+Sq8RPpYWImkebO7fKxAg1QmBBP8TK8kzbxpVdaYwTErrBNDGQGyWtceUjPiN6 Y6LX9DNUGndbr4ht2Ak1Ua7tJD55Ty00DYqzt+Fv1UNrUgm+EbXINcNgEB5c+sFWr4XV W/QTSQEO9yTQty/VdERiH2CloxYasJlz7a/BjT4kr4mzl6j5eZVH1MOTPnLG8sUNhWjC wtI79xbUGh/CHtVdyVtVLr4gBYMqb/VmAcnXGAS2UdURU1ihfPHZF8xU7V3HBscTtQBd N1ig== X-Gm-Message-State: APjAAAUBVKQ++rF4Z2VLxx54YCrkznH9D3W13Etx0u6X+0byWfQYmkQn V2HkYE5sFvsYEsaDBfyA4+zM3Q== X-Google-Smtp-Source: APXvYqzRDEXIROUj1ScftMPe3VEkpbwqYyiANk1hZrVKNg4lgyCGoEyn28TSJYbTDd8iZUElXznZ+w== X-Received: by 2002:a0c:81d4:: with SMTP id 20mr10746153qve.2.1554476465357; Fri, 05 Apr 2019 08:01:05 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id q30sm14785779qtk.85.2019.04.05.08.01.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Apr 2019 08:01:04 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id D60DD120CBF; Fri, 5 Apr 2019 12:01:02 -0300 (-03) Date: Fri, 5 Apr 2019 12:01:02 -0300 From: Alvaro Herrera To: Peter Eisentraut Cc: Rahila Syed , Andres Freund , Robert Haas , Simon Riggs , Pg Hackers , David Fetter , Pavan Deolasee , Amit Langote Subject: Re: monitoring CREATE INDEX [CONCURRENTLY] Message-ID: <20190405150102.GA2616@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-Apr-05, Peter Eisentraut wrote: > It seems we can easily extend this to also monitor REINDEX > [CONCURRENTLY]. Attached is a quick patch. That's much easier than I was expecting. I think we should endeavor to get this done for pg12. > For the concurrently part, we currently don't have any phases defined > for the index swap and drop, but maybe we can just skip that initially. > What happens if we don't have those? Users are going to wonder why the other phases don't appear to complete for a long time :-) Keep in mind that the "waiting" phases are very confusing to users. I suggest we just define additional phase numbers for those phases, then switch the "false" argument to WaitForLockersMultiple to "true", and it should work :-) Doc-wise, list all the phases in the same docbook table, indicate that REINDEX is also covered, and document in an easier-to-follow fashion which phases each command goes through. > It might be nice to have a column in the view not only for the table OID > but also the index OID. That is obviously not so useful for CREATE > INDEX but more useful for REINDEX. I haven't looked into how adding > that would work. Yeah, I think that's simple enough -- the CLUSTER one already does that, I think. Another thing for REINDEX TABLE is that we should add a count of indexes to process, and how many are done. I was wondering about reporting the command being run. In the progress_cluster view we have a "command" column, which says either CLUSTER or VACUUM FULL. I didn't add one for CREATE INDEX vs. CONCURRENTLY because it seemed to me that joining to pg_stat_activity ought to be sufficient. If we agree with that reasoning, then we should remove the column from the CLUSTER view, I think. If not, we should add one to the create_index view. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services