pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Marc Lessard <Jean-Marc.Lessard@ultra-ft.com>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: RE: pg_dump out of memory for large table with LOB
Date: Wed, 21 Nov 2018 17:18:28 +0000
Message-ID: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811CA13@SRV-CAMTL-EXCH2.Forensictech.com> (raw)
In-Reply-To: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811C37B@SRV-CAMTL-EXCH2.Forensictech.com>
References: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811C1EF@SRV-CAMTL-EXCH2.Forensictech.com>
	<65acf49d-5f76-45f1-a0bc-9dad953b902f@manitou-mail.org>
	<8FC5F25FF3EC4744ADFCF20CBA3F44BE016811C37B@SRV-CAMTL-EXCH2.Forensictech.com>

JMLessard wrote:
> What about updates where the bytea do not changed. Does a new copy of the bytea will be made in the toast table or new row will point to the original bytea?
> > https://www.postgresql.org/docs/current/storage-toast.html says:
> > The TOAST management code is triggered only when a row value to be stored in a table is wider than TOAST_TUPLE_THRESHOLD bytes (normally 2 kB). The TOAST code will compress
> > and/or move field values out-of-line until the row value is shorter than TOAST_TUPLE_TARGET bytes (also normally 2 kB, adjustable) or no more gains can be had. During an UPDATE
> > operation, values of unchanged fields are normally preserved as-is; so an UPDATE of a row with out-of-line values incurs no TOAST costs if none of the out-of-line values change.
> Does it means, no incurs cost to generate the out of line toast, but that a copy of the bytea is still made for the new line?

I bench mark it as follow:
UPDATE table SET mod_tim=mod_tim;
The relpages of the table doubled, but the relpages of the toast table did not changed.

Jean-Marc Lessard
Administrateur de base de donn?es / Database Administrator
Ultra Electronics Forensic Technology Inc.
T +1 514 489 4247 x4164
www.ultra-forensictechnology.com<http://www.ultra-forensictechnology.com;

view thread (11+ messages)  latest in thread

Message-ID: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811CA13@SRV-CAMTL-EXCH2.Forensictech.com>
Permalink:  ../8FC5F25FF3EC4744ADFCF20CBA3F44BE016811CA13@SRV-CAMTL-EXCH2.Forensictech.com/
Also on:    postgresql.org/message-id/8FC5F25FF3EC4744ADFCF20CBA3F44BE016811CA13@SRV-CAMTL-EXCH2.Forensictech.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: Jean-Marc.Lessard@ultra-ft.com, daniel@manitou-mail.org
  Subject: Re: pg_dump out of memory for large table with LOB
  In-Reply-To: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811CA13@SRV-CAMTL-EXCH2.Forensictech.com>
  References: <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811C1EF@SRV-CAMTL-EXCH2.Forensictech.com> <65acf49d-5f76-45f1-a0bc-9dad953b902f@manitou-mail.org> <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811C37B@SRV-CAMTL-EXCH2.Forensictech.com> <8FC5F25FF3EC4744ADFCF20CBA3F44BE016811CA13@SRV-CAMTL-EXCH2.Forensictech.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