pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Large objects and out-of-memory
Date: Mon, 21 Dec 2020 13:27:25 -0500
Message-ID: <543675.1608575245@sss.pgh.pa.us> (raw)
In-Reply-To: <7c57860c-fc05-143e-aa81-f11ca13ec00a@postgrespro.ru>
References: <7c57860c-fc05-143e-aa81-f11ca13ec00a@postgrespro.ru>

Konstantin Knizhnik <k.knizhnik@postgrespro.ru> writes:
> The following sequence of command cause backend's memory to exceed 10Gb:

> INSERT INTO image1 SELECT lo_creat(-1) FROM generate_series(1,10000000);
> REASSIGN OWNED BY alice TO testlo;

[ shrug... ]  You're asking to change the ownership of 10000000 objects.
This is not going to be a cheap operation.  AFAIK it's not going to be
any more expensive than changing the ownership of 10000000 tables, or
any other kind of object.

The argument for allowing large objects to have per-object ownership and
permissions in the first place was that useful scenarios wouldn't have a
huge number of them (else you'd run out of disk space, if they're actually
"large"), so we needn't worry too much about the overhead.

We could possibly bound the amount of space used in the inval queue by
switching to an "invalidate all" approach once we got to an unreasonable
amount of space.  But this will do nothing for the other costs involved,
and I'm not really sure it's worth adding complexity for.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <543675.1608575245@sss.pgh.pa.us>
Permalink:  ../543675.1608575245@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/543675.1608575245@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, k.knizhnik@postgrespro.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: Large objects and out-of-memory
  In-Reply-To: <543675.1608575245@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