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 1sqTZs-00A1bx-Fo for pgsql-general@arkaria.postgresql.org; Tue, 17 Sep 2024 08:28:53 +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 1sqTZs-007Gur-5s for pgsql-general@arkaria.postgresql.org; Tue, 17 Sep 2024 08:28: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 1sqTZr-007Gu1-F0 for pgsql-general@lists.postgresql.org; Tue, 17 Sep 2024 08:28:51 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqTZo-001btC-Mi for pgsql-general@lists.postgresql.org; Tue, 17 Sep 2024 08:28:50 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 2B8FC138049C; Tue, 17 Sep 2024 04:28:48 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 17 Sep 2024 04:28:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726561728; x= 1726648128; bh=wJ5Sc0UzeoT1buM4SZoMdlyC61RcHg2oh7oxhNB98q8=; b=f hSeTYwbg4owF6TnvbNFacMhq0Qx7uflqnjNXiimJYon/p8UvOmN3eM2cuPQTwWC9 EcFZO5Mgr0dTO3OiNL+vQGV91UDVenH/5EMd8bnlg5M/PSA8ETEtyeWH7X6FPbY1 zswnvoxfWLO6LNry6FpWKWOdE7BwXzT/nioPrr8vAFIK4wgEhBbUYvkqty5bhMsi 3ub5y3LBywbw5NFTQUgR6WkiheapKJ5b0NWVDVtGVbHdUZ+zcLEQyZc4yP98pe0T ieiEZf81Zm/R2NUGE9xs0HP6p8ZG+umTmRX2nE6OokxntbZEs1joPiHV4G4EoIiS 91Mr/BK3H+VF8KeWFosfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudekjedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvve fukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghr rgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtth gvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeffgfdufffhudffffeu veenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrghdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheplhgvrghrnhgvrhgurghtrggsrghsvgelleesghhmrghilhdrtgho mhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrh gvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Sep 2024 04:28:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1726561725; bh=Ni5BrKSeZnt5QFjQ426DnNafGG1xKORFLvoAO72DOag=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=o5kV8F5Q7qr61HM6zZhCLSpKoqrmG9f1unJ0TjBjjvDhL0X4ZM4qf09Yb4VMJSWvo o9oeRz1VNRMl4q+HFc/sh1u8sI9vClLCcwiWvWZb9Vacr4oMevrueMU2GlcG4yNji/ u2kiNWARn823tI5BOk4rdX//UAYF/B82qjX9ngw/Gyn+vr7B4Od/9jVg1M8Em58aJ5 +i/2jJ0ez9LIWNg1ub4aFtFMzCqCr0ESUHSSLSw7+PFmidn97Qd7XjnPeXAat7gtj3 9i0a5m9bI26RmuC6PFbWChOuHzUtc1n3GVuOZPlSPARKS3oeh1pUSBDUc/RpKDwM33 5USu6W2p/qaYA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 6B735B1; Tue, 17 Sep 2024 10:28:45 +0200 (CEST) Date: Tue, 17 Sep 2024 10:28:45 +0200 From: Alvaro Herrera To: yudhi s Cc: pgsql-general Subject: Re: update faster way Message-ID: <202409170828.kioipz3ryfof@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 2024-Sep-14, yudhi s wrote: > Hello, > We have to update a column value(from numbers like '123' to codes like > 'abc' by looking into a reference table data) in a partitioned table with > billions of rows in it, with each partition having 100's millions rows. Another option is to not update anything, and instead create a view on top of the partitioned table (joined to the reference table) that returns the reference value instead of the original number value from the column; when the application wants to receive those reference values, it queries the view instead of the partitioned table directly. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "I think my standards have lowered enough that now I think 'good design' is when the page doesn't irritate the living f*ck out of me." (JWZ)