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 1o93Hw-0004VW-PI for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 11:33:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o93Hv-0000iw-CF for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 11:33:47 +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 1o93Hu-0000Mq-IV for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 11:33:47 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o93Hn-0000nA-Bq for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 11:33:45 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1EEB45C00D7; Wed, 6 Jul 2022 07:33:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 06 Jul 2022 07:33:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1657107218; x=1657193618; bh=V xn2+3/T4G/JtTF/0DcCDrgIxxWbWYzwYfCzKQwWLS8=; b=H4M3eZlEMJhSvlUh0 wmxPdRJgM8SOp/N5DCX0fviAD7WaMnDCcXaDKNPdTcDDAK+Mgq0znPlAlFpqdy4v ShFu4UOPVrVlwtmB0pqCT59u5uW/aGSzyEwZFUwS5Gjapm3cch1mM6QcN+/jRDHW 0rdP+Q9nif60jKTqX5ZuaRiLsjtXf066oRksqdD2pjPZuozTAlETcJRQNCeHgyGC OIGKIaxkUhp3XflXktEACQbujTEOB7PuZT4K1lQ0yQs83thgEMdIydb/N3+rLUpI QhQnbX+vJ4OoFhmA4wf/ahPgTGcOugc/DV3lTFF6DqzAytC/TCgch3jY05MnvWVM zD1xw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeifedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Jul 2022 07:33:37 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id EC17535D; Wed, 6 Jul 2022 13:33:33 +0200 (CEST) Date: Wed, 6 Jul 2022 13:33:33 +0200 From: Alvaro Herrera To: Florents Tselai Cc: Francisco Olarte , Peter Eisentraut , pgsql-general Subject: Re: ADD COLUMN ts tsvector GENERATED too slow Message-ID: <20220706113333.leh3lnzkvzn2dgbo@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Jul-06, Florents Tselai wrote: > Actually, I monitored my disk usage and it was **definitely** working as > It had already eaten up an additional 30% of my disk capacity. Adding a column like this requires creating a second copy of the table, copying all the contents from the old table (plus the new column) into the new one, then recreating all indexes from scratch on the new copy of the table. If you have a lot of indexes, this can be significant. Also, AFAIU all data has to be uncompressed on read, then compressed back on write. Note: the 80 GB from pg_relation_size() does *not* include the size of TOAST data. You're copying a lot of additional data. See pg_table_size(). -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)