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 1sTaBD-000BGE-DQ for pgsql-general@arkaria.postgresql.org; Tue, 16 Jul 2024 04:52:47 +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 1sTaBB-00FKdK-Ru for pgsql-general@arkaria.postgresql.org; Tue, 16 Jul 2024 04:52:45 +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 1sTaBB-00FKdB-HC for pgsql-general@lists.postgresql.org; Tue, 16 Jul 2024 04:52:45 +0000 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sTaB8-002HYL-MA for pgsql-general@lists.postgresql.org; Tue, 16 Jul 2024 04:52:44 +0000 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-5b53bb4bebaso2890680eaf.0 for ; Mon, 15 Jul 2024 21:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721105562; x=1721710362; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=53pzEajToK40sBCf70ceJJTL20hxoq5rHBlvp5uMkgM=; b=lGRgFN2mGg/7+YM9qwxlt7mOrqNMq7cnpyhEqKxPKpL1qYtjUcYIWxckemXilwY3/Y j14lfWew0XEBJ8gV2ZVMqe5UA6gU/KBRYoWiv5TsaWb7+QICtS243iQ/mCM5jV+lYJCF jctrjzLVRG0wCuSFsiIfV1bBbtuJ3UaT3h86+GlB+Q5mEj7fWu1qp3UHG7X1QPOHQ4cy jkvRsfkyKT8DzFUYaT+0PenFxXImd0+w4SiHymCXyA1X7H4H++pnCq2KYnHpVkQPQ00p x/scbyWMvvMDiD8ObSmZg21XfEzkvdgarAHFzHly2UxQv8zct5Bv2VPdNJqwbBv4r8c2 X4YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721105562; x=1721710362; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=53pzEajToK40sBCf70ceJJTL20hxoq5rHBlvp5uMkgM=; b=Xa5blK+A6O2TEY/1pDZtcgZUDHVrWoyPzNHgZWqsLqP5rhqnD+QOIhsxpi+hQSMj9U qB21gXSPTeRIFv04/m+sQy6vVTEfWdnrP2Z/X/vqOra0XWJSTDuj2FKwnpdm2DKeMA3d KxgIApY1fTDxkKPbt30W/hpYq0x+hffDoBTStkfkuw56SM7vQt0iGlJgT5F0cBhWQ8vP uj/2eMvJPIBEngRpF3Eruvo4CdshJlqYShFedc8RvdiuCrM3iT0HLjgeyHnKWmbRZNOL V+wXazPcHzdTBBZktkBcHRkon54t5Jg1IXGt7Tu37nM+Gkru4214EphLSxjiMIKIOgZ/ tVGw== X-Gm-Message-State: AOJu0YwtyeLOIDy7vzhU1d0nYPxFfTW9CJP8D8Z8qHiHiV3pssV/vyXN nQhL4YmxaGuLLI6aN/OGb0x5a8emlGshMQGbawJhZFT3fxZKApwP0erJp1b7T1LQlmRxaiHPGDV bdCnT+zTP/JYlJRWiv75ULjqpNsY= X-Google-Smtp-Source: AGHT+IESn/n6kdR5RZm3FYoRp+APIo9koaTiIhfVMcxrjOtjZ1oO/skdXphCG9X8lz3tvv52ToZ6BrKM8/rNTtiQO+I= X-Received: by 2002:a4a:edc8:0:b0:5c4:5cbc:b1b5 with SMTP id 006d021491bc7-5d2840661a1mr1431662eaf.0.1721105561992; Mon, 15 Jul 2024 21:52:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:760a:0:b0:539:aa10:6c7 with HTTP; Mon, 15 Jul 2024 21:52:41 -0700 (PDT) In-Reply-To: References: <20240713220545.cgjghaggksov3xkt@hjp.at> <20240715142744.7e7a3wtdfxinochf@hjp.at> <20240716003731.m75sye7qq74wadhe@hjp.at> From: "David G. Johnston" Date: Mon, 15 Jul 2024 21:52:41 -0700 Message-ID: Subject: Re: Dropping column from big table To: sud Cc: "pgsql-general@lists.postgresql.org" , "Peter J. Holzer" Content-Type: multipart/alternative; boundary="000000000000a4c676061d561da5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a4c676061d561da5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, July 15, 2024, sud wrote: > > However even with "vacuum full", the old rows will be removed completely > from the storage , but the new rows will always be there with the 'droppe= d' > column still existing under the hood along with the table storage, with > just carrying "null" values in it. [=E2=80=A6] Is this understanding corr= ect? > No. The table rewrite process involves creating new tuples that exactly conform to the current row specification. The potentially non-null data present in live tuples for columns that have been dropped are not copied into the newly constructed tuples. https://github.com/postgres/postgres/blob/d2b74882cab84b9f4fdce0f2f32e892ba= 9164f5c/src/backend/access/heap/heapam_handler.c#L2499 David J. --000000000000a4c676061d561da5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, July 15, 2024, sud <sud= s1434@gmail.com> wrote:

However even with "vacuum full", the ol= d rows will be removed completely from the storage , but the new rows will = always be there with the 'dropped' column still existing under the = hood along with the table storage,=C2=A0 with just carrying "null"= ; values in it. [=E2=80=A6] Is this understanding correct?
<= /div>

No.=C2=A0 The table rewrite process i= nvolves creating new tuples that exactly conform to the current row specifi= cation.=C2=A0 The potentially non-null data present in live tuples for colu= mns that have been dropped are not copied into the newly constructed tuples= .


--000000000000a4c676061d561da5--