From: | Alban Hertroys <haramrae(at)gmail(dot)com> |
---|---|
To: | Lok P <loknath(dot)73(at)gmail(dot)com> |
Cc: | sud <suds1434(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Column type modification in big tables |
Date: | 2024-08-08 18:55:22 |
Message-ID: | 7D2FBDFB-40DD-4458-B213-03EB7311EC4D@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> On 8 Aug 2024, at 20:38, Lok P <loknath(dot)73(at)gmail(dot)com> wrote:
>
> Thank you so much.
>
> Can anybody suggest any other possible way here. As, we also need to have the existing values be updated to the new column value here using update command (even if it will update one partition at a time). And as I see we have almost all the values in the column not null, which means it will update almost ~5billion rows across all the partitions. So my question is , is there any parameter(like work_mem,maintenance_work_mem etc) which we can set to make this update faster?
> or any other way to get this column altered apart from this method?
Just a wild thought here that I’m currently not able to check… Can you add views as partitions? They would be read-only of course, but that would allow you to cast the columns in your original partitions to the new format, while you can add any new partitions in the new format.
I suspect it’s not allowed, but perhaps worth a try.
Alban Hertroys
--
There is always an exception to always.
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2024-08-08 19:01:02 | Re: Destination Table - Condition Amount 0 |
Previous Message | Alban Hertroys | 2024-08-08 18:48:32 | Re: Destination Table - Condition Amount 0 |