Re: Column reset all values

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Column reset all values
Дата
Msg-id 20200513083549.GA23847@hjp.at
обсуждение исходный текст
Ответ на Column reset all values  (otar shavadze <oshavadze@gmail.com>)
Список pgsql-general
On 2020-05-13 12:13:20 +0400, otar shavadze wrote:
> postgres version 12
> I have very simple update query, like this:
>
> update my_table 
> set 
> col = NULL
> where
> col IS NOT NULL;
>
> my_table contains few million rows, col is indexed column

You might want to drop the index before doing this. You obviously won't
need the index afterwards and the database may be able to use HOT
updates if there is no index on the column (but that depends on the
amount of unused space in each block).

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: otar shavadze
Дата:
Сообщение: Column reset all values
Следующее
От: Olivier Gautherot
Дата:
Сообщение: Re: Column reset all values