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 1lo9Tt-0007Qf-AR for pgsql-general@arkaria.postgresql.org; Tue, 01 Jun 2021 18:51:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lo9Ts-00056o-AT for pgsql-general@arkaria.postgresql.org; Tue, 01 Jun 2021 18:51:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo9Ts-00056g-1j for pgsql-general@lists.postgresql.org; Tue, 01 Jun 2021 18:51:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo9Tn-0000Yo-Dd for pgsql-general@lists.postgresql.org; Tue, 01 Jun 2021 18:51:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 151Ip5CK2847073; Tue, 1 Jun 2021 14:51:05 -0400 From: Tom Lane To: Philip Semanchuk cc: Vijaykumar Jain , PostgreSQL General Subject: Re: CREATE/REFRESH MATERIALIZED VIEW planner difference? In-reply-to: References: Comments: In-reply-to Philip Semanchuk message dated "Tue, 01 Jun 2021 14:26:00 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2847071.1622573465.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Jun 2021 14:51:05 -0400 Message-ID: <2847072.1622573465@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Philip Semanchuk writes: > I can confirm that it=E2=80=99s not waiting on a lock. In addition, thro= ugh the AWS CPU utilization monitor I can see that the REFRESH uses one CP= U/worker whereas the CREATE uses four. This is consistent with the EXPLAIN= ANALYZE for the CREATE which says it uses four workers. Hm. I tried to reproduce this here, and in a simple test case I get parallelized plans for both CREATE and REFRESH. Are you sure the REFRESH is running with the same server parameter settings? >> also, can you share the plans where you see the diff. > Unless I misunderstand, there is no plan for a REFRESH. EXPLAIN isn't bright about that, but if you enable auto_explain, it will log the plan for a REFRESH's query. regards, tom lane