Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdxdX-002e8J-Gw for pgsql-general@arkaria.postgresql.org; Tue, 13 Aug 2024 19:56:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sdxdU-006A8O-SY for pgsql-general@arkaria.postgresql.org; Tue, 13 Aug 2024 19:56:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdxdU-006A8F-CD for pgsql-general@lists.postgresql.org; Tue, 13 Aug 2024 19:56:52 +0000 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sdxdR-004ahd-DN for pgsql-general@lists.postgresql.org; Tue, 13 Aug 2024 19:56:50 +0000 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e0ba5c5184dso527790276.1 for ; Tue, 13 Aug 2024 12:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723579008; x=1724183808; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qnb+/wzwHa5aiyowNi8VFPbV+3gLmfObipjXpUdQwNc=; b=N7bIsR1rJYt/jT7oXlb/qz/jmx8JJxRPciby6ZEMaE7UtQzsPwxpaiFFQRt43OX4AQ jKkM6Btbw5gthhUnrVABd35qLVEV1IBVAW/H7yTOFXy2lbJvXZS4xLo0h25aJn3xnDSz VIgolZ0ygt/H33bgE0DiQT2EcSrzZ9ngtIE0/w7ko/isKMJi0a+4Hze5PZbrnZoKd2B7 MFghRisuyIjcPZluwTlbQr5E6DgekFGrVuzXyMQIjdj6ubAhP5yDpzpvLuKF5ncjQ+hd cmNdpzyfLnHi2maw37M23bgQcmdLHEKFjHxmb2G+9kkEi0PQrikaCcTQ22di5MeDNkk7 YhNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723579008; x=1724183808; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qnb+/wzwHa5aiyowNi8VFPbV+3gLmfObipjXpUdQwNc=; b=HB4hgq4ADs9NYeSqv3rzkbHi5p2oYFTf1P6NZ1C3wpbZCrfsFPGe5UCVzxwixjpTZ6 X9V0Nmz67dNXvhiYr6GGmpUVF+5eLXJBFwsxpToFhLjiCeW6FW8jlrEpbneOBcJzoFrd wnn5pVceb26bSCCkWL6F57jLqVIYFiGOa+r9sHLEEhQqOVYhK5O9Gilq67S8NABsE6ck e2iBHS+UAw1gn/b9pLdpA/eeQ47I9rXK6xn1mxkdvOuKTdn4IDQry7p7wseRv65AHlbr QnzzCu4qXWS4kdQL7aY+I+CVy96+D2rsxehn7XQgpkxHJz5mxtWGsWINKY5j3m/nslJn 3xsg== X-Forwarded-Encrypted: i=1; AJvYcCVzhw3g4nOx790HseURq1zeO/sNMTo6Ty/pU/gBr32pjpw//rs8aIa+vODhsuDwuJ5xRNiK/HW2wu+KfHAwc356VVbBZfm5fE6wZ586UvYTCcH9 X-Gm-Message-State: AOJu0YwAM03CdJObfPR5s7nCqtGzDkNYYn+uP60VthhLXnXwv9WSZ7pc hBGX0+RGSor8icMHbN+OLG7DQZHuLtgBr+msXUTM6bvfOoTLGK+ixtkbsbSNX/UcMJb2cgnWKig ga6pihwH8m/PbPmhzUU9/rlEkdxw= X-Google-Smtp-Source: AGHT+IECsPEAGwcup0z5uEZor8b5xzLBfknTdp6LhvtVM885/vfoHUAa4p0wSG4fNUQzE2tOw/EbwvcHCf6urksj46I= X-Received: by 2002:a25:cecf:0:b0:e11:5738:85f7 with SMTP id 3f1490d57ef6-e11573886e1mr157747276.6.1723579008219; Tue, 13 Aug 2024 12:56:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lok P Date: Wed, 14 Aug 2024 01:26:36 +0530 Message-ID: Subject: Re: Column type modification in big tables To: Greg Sabino Mullane Cc: sud , pgsql-general Content-Type: multipart/alternative; boundary="0000000000008701b2061f96029e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008701b2061f96029e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 13, 2024 at 7:39=E2=80=AFPM Greg Sabino Mullane wrote: > On Sat, Aug 10, 2024 at 5:06=E2=80=AFPM Lok P wrot= e: > > >> Can someone through some light , in case we get 5-6hrs downtime for this >> change , then what method should we choose for this Alter operation? >> > > We can't really answer that. Only you know what resources you have, what > risk/reward you are willing to handle, and how long things may take. For > that latter item, your best bet is to try this out on the same/similar > hardware and see how long it takes. Do a smaller table and extrapolate if > you need to. Or promote one of your replicas offline and modify that. I'v= e > given you a low-risk / medium-reward option with check constraints, but f= or > the ALTER TABLE options you really need to try it and see (on non-prod). > > *"Do a smaller table and extrapolate if you need to. Or promote one of your replicas offline and modify that. I've given you a low-risk / medium-reward option with check constraints, but for the ALTER TABLE options you really need to try it and see (on non-prod)."* Is there any possible method(maybe by looking into the data dictionary tables/views etc) to see the progress of the Alter statement by which we can estimate the expected completion time of the "Alter" command? I understand pg_stat_activity doesn't show any completion percentage of a statement, but wondering if by any other possible way we can estimate the amount of time it will take in prod for the completion of the ALTER command= . --0000000000008701b2061f96029e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Tue, Aug 13, 2024 at 7:39=E2=80=AFPM G= reg Sabino Mullane <htamfids@gmail= .com> wrote:
On Sat, Aug 10, 2024 at 5:06=E2=80=AF= PM Lok P <lokn= ath.73@gmail.com> wrote:
=C2=A0=
Can someone through=C2=A0some light , in case= we get 5-6hrs downtime for this change , then what method=C2=A0should=C2= =A0we choose for this Alter operation?

We can't really answer that. Only you know what resou= rces you have, what risk/reward you are willing to handle, and how long thi= ngs may take. For that latter item, your best bet is to try this out on the= same/similar hardware and see how long it takes. Do a smaller table and ex= trapolate if you need to. Or promote one of your replicas offline and modif= y that. I've given you a low-risk / medium-reward option with check con= straints, but for the ALTER TABLE options you really need to try it and see= (on non-prod).

=C2=A0
"Do a smaller table and extrapolate if you need to. Or prom= ote one of your replicas offline and modify that. I've given you a low-= risk / medium-reward option with check constraints, but for the ALTER TABLE= options you really need to try it and see (on non-prod)."

Is there any possible method(maybe by looking = into the data dictionary tables/views etc) to see the progress of the Alter= =C2=A0statement by which we can estimate the expected completion time of th= e "Alter" command? I understand pg_stat_activity doesn't=C2= =A0show any completion percentage of a statement, but wondering if by any o= ther possible way we can estimate the amount of time it will take in prod f= or the completion of the=C2=A0ALTER=C2=A0command.
--0000000000008701b2061f96029e--