Re: update faster way - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: update faster way
Date
Msg-id 202409170828.kioipz3ryfof@alvherre.pgsql
Whole thread Raw
In response to update faster way  (yudhi s <learnerdatabase99@gmail.com>)
List pgsql-general
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)



pgsql-general by date:

Previous
From: Thomas Ziegler
Date:
Subject: Re: Failing to allocate memory when I think it shouldn't
Next
From: "Zwettler Markus (OIZ)"
Date:
Subject: question on plain pg_dump file usage