Re: When Update balloons memory

From: Klaudie Willis <Klaudie(dot)Willis(at)protonmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: When Update balloons memory
Date: 2021-12-14 08:16:08
Message-ID: lviv_r7tA44gnx3rRU8VYdseWJLx-AzQCbsgdyz2-1Lse9ZmqDeLnzfDkBTut26kxlPZ8FX36TiKmCtXi5gAfhI-JVu-2n8fu7Dcta0Y3Ek=@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Hi,

Turns out the base case is simpler than I thought. Not involving partitions at all

CREATE TABLE public.part_main (
txid bigint,
actiondate timestamp without time zone NOT NULL
);

insert into part_main
select x, '2019-06-01'::timestamp + x%365 * interval '1 day'
from generate_series(1, 30 * 1E6) as x;

CREATE INDEX partindx ON public.part_main USING btree ((actiondate)::date); -- mem bug?
-- CREATE INDEX partindx ON public.part_main USING btree (actiondate); -- no bug
-- mem runaway follows
update part_main set txid = txid + 1;

Hope you can replicate it.

best regards
Klaudie

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Tuesday, December 14th, 2021 at 12:17 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Klaudie Willis Klaudie(dot)Willis(at)protonmail(dot)com writes:
>
> > So, it seems like the index is central cog here:
> >
> > > create index ind1 on alpha ((deltatime::date));
> > >
> > > where "alpha" is a partition tableset partitioned by (deltatime::date)
> > >
> > > The general and simple updates like:
> > >
> > > update alphatable set gamma=gamma || "#postfix#"
> > >
> > > makes the process memory balloon to the point of OOM.
>
> That seems like a bug, but please supply a self-contained test case
>
> rather than expecting other people to reverse-engineer one.
>
> regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-12-14 08:53:13 BUG #17336: logtape sort performance and overflow
Previous Message Kyotaro Horiguchi 2021-12-14 01:11:37 Re: BUG #17327: Postgres server does not correctly emit error for max_slot_wal_keep_size being breached

Browse pgsql-general by date

  From Date Subject
Next Message Dominique Devienne 2021-12-14 09:39:42 Re: LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback
Previous Message David G. Johnston 2021-12-14 06:29:34 Re: locks within select