pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ruslan.ganeev@list.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18166: 100 Gb 18000000 records table update
Date: Fri, 20 Oct 2023 21:22:40 -0400
Message-ID: <4020107.1697851360@sss.pgh.pa.us> (raw)
In-Reply-To: <18166-8d0f3718572475ef@postgresql.org>
References: <18166-8d0f3718572475ef@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> We tried to make a script, which sets enddate = '2022-12-31' for all
> records, having the value in «DataVip» that is not maximal.  For other
> records the script set s enddate = null
> The problem is that the script is running for 6 hours, the main percentage
> of time is taken by the rebuilding of indexes.

This is not a bug.  However ... a common workaround for bulk updates
like that is to drop all the table's indexes and then recreate them
afterwards.  It's often quicker than doing row-by-row index updates.

			regards, tom lane





view thread (2+ messages)

Message-ID: <4020107.1697851360@sss.pgh.pa.us>
Permalink:  ../4020107.1697851360@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4020107.1697851360@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ruslan.ganeev@list.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18166: 100 Gb 18000000 records table update
  In-Reply-To: <4020107.1697851360@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox