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 1lo8gn-0004uf-Ra for pgsql-general@arkaria.postgresql.org; Tue, 01 Jun 2021 18:00:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lo8gl-0001Mz-8K for pgsql-general@arkaria.postgresql.org; Tue, 01 Jun 2021 18:00:27 +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 1lo8gk-0001Mr-Sc for pgsql-general@lists.postgresql.org; Tue, 01 Jun 2021 18:00:26 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lo8ge-00005U-Bd for pgsql-general@lists.postgresql.org; Tue, 01 Jun 2021 18:00:25 +0000 Received: by mail-qk1-x731.google.com with SMTP id v8so15192444qkv.1 for ; Tue, 01 Jun 2021 11:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=americanefficient-com.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=b0jH3LyThE0iEkBFsgsit+l7sK4Eu5Y9cNmAfDeY9ok=; b=1vwBg3gHU5m33vKormIiuUjlH6gnPVyoLyw1Qc1ON8y/ZfrGA+LLerMJ38XOa3/fbS zsdcMU2JDlx+4HvuD+R3Rsx6GeT4AqLY7/3Pa/dR+8brveVX+HT2xdNV0gPNNPeUTX7D BPhouw+kNe9vM6cd428IpQXgdAb2sXHzpoZNi6YYLpe/ZewzwSlFwLDf5HTOVsFNxnuN R4KrGOoc1k4WmjbY1b1k1YiGTaGGcYc4y9UEtCe2z77I5kr2KiU1GLUeNwm5kcUuFFIi mZnqd0GDICAFMrCiWFKwsYcAC4hy75pY+GbJWCXU6eNC60i5EQSNVkHTFd2BA5ahURCQ w4Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=b0jH3LyThE0iEkBFsgsit+l7sK4Eu5Y9cNmAfDeY9ok=; b=T/C8aaBKdmLeP7emj+eWXZqzx/6JS85PtD/9zCZAqCYHk41mQSxKngMOLRQuV3vpsM EWKTG0ty1JNGyqegdm5dcVFjIsIzitIL8rpNEO7BgSRG3mJS5vYleAe+HpH1whuQU/rm LUkdVGsEXbWYVXofZd1SmBhIRLYS1HQSsIx7uoId7TaygLIR2Gx34qZVsW8E1TP45YEZ QKcBHvk2HUVzEZCwnaRxRu8DoiLyeCacqtQp+jtM0JfrINNQK5ndO4+Oy/cc8o8EX1pJ GGT1H+kn/D+W6i2BnpGfdtxkEukuAl7fXYzPk6a7hslX3c7LZenc7oJz5FwyCpOSrjeF wJSw== X-Gm-Message-State: AOAM530OOW/jY6TpWZcNhyeWkdT0wwtSYsGt6SyCc2pORG0xTzYrj2sR uIhMSfwTfgu+qRDhgBQsiFmI/W2vNlucmE/Cztd3J2I/zEPgvGBsPGKALGMEX+iiYF4uh7b6mps rNKV8SQoWLbgDc+SgO8UWCdgiABudcQrOY9JBhc7MF3KvTJpiTO9bhWvheXSC6SXjwfIMOBXPKl xr+RsKEQg/G2MRTXCzdyDWoT7Q X-Google-Smtp-Source: ABdhPJy6NI3yW6Ixt1d48Yx2fVGpRNYW0jZ8C7+oJ9nudlMOZ436VowGx1wwF47iX9wy9Z3hcF9Mew== X-Received: by 2002:a05:620a:3dd:: with SMTP id r29mr23012704qkm.468.1622570418300; Tue, 01 Jun 2021 11:00:18 -0700 (PDT) Received: from smtpclient.apple (cpe-98-26-29-163.nc.res.rr.com. [98.26.29.163]) by smtp.gmail.com with ESMTPSA id r25sm1534866qtu.82.2021.06.01.11.00.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jun 2021 11:00:17 -0700 (PDT) From: Philip Semanchuk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: CREATE/REFRESH MATERIALIZED VIEW planner difference? Message-Id: Date: Tue, 1 Jun 2021 14:00:16 -0400 To: PostgreSQL General X-Mailer: Apple Mail (2.3654.100.0.2.22) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi all, Should I expect a planner difference between CREATE MATERIALIZED VIEW = and REFRESH MATERIALIZED VIEW? We have a materialized view that uses 4 = workers during CREATE but only one worker during REFRESH, and as a = result the refresh takes much longer (~90 minutes vs. 30 minutes for the = CREATE). So far this behavior has been 100% consistent. I'm running both the CREATE and REFRESH on the same server (Postgres = 11.9 on AWS Aurora). I don't think the refresh is using one worker in = response to other things happening on the server because we=E2=80=99ve = observed this happening when the server is not busy. We're not using the = CONCURRENTLY option for REFRESH. THanks Philip=