pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: is single row update improved with function
Date: Sun, 31 Dec 2017 16:06:30 -0700
Message-ID: <D64DD424-9BAD-41C5-92E2-0F5F78752B4F@gmail.com> (raw)

I must update 3M of 100M records, with tuple specific modifications.  I can generate the necessary sql, but I’m wondering if files of simple update statements affecting a single row is more effective than files of a function call doing the same update given the necessary values, including where clause restrictions?  The query plan set by the first should be decent for the remainder.

Alternatively, would a bulk load into a table of replacement values and join info be the fastest way?  

Either way I can break the updates into roughly 393 transactions (7500 rows affected per tx) or 8646 transactions (350 rows  per tx) if less is more in this world.

I’ll be the only user during this work.

OS=centos 7, 4core virtual 64G memory; pg=10.0;



view thread (4+ messages)  latest in thread

Message-ID: <D64DD424-9BAD-41C5-92E2-0F5F78752B4F@gmail.com>
Permalink:  ../D64DD424-9BAD-41C5-92E2-0F5F78752B4F@gmail.com/
Also on:    postgresql.org/message-id/D64DD424-9BAD-41C5-92E2-0F5F78752B4F@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: is single row update improved with function
  In-Reply-To: <D64DD424-9BAD-41C5-92E2-0F5F78752B4F@gmail.com>
  References: <D64DD424-9BAD-41C5-92E2-0F5F78752B4F@gmail.com>

* 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