Re: ANALYZE: ERROR: tuple already updated by self

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org,Justin Pryzby <pryzby(at)telsasoft(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: ANALYZE: ERROR: tuple already updated by self
Date: 2019-06-19 01:06:13
Message-ID: B85C6948-3793-4D1F-A166-404F2E89A412@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On June 18, 2019 5:38:34 PM PDT, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
>On Tue, Jun 18, 2019 at 06:48:58PM -0500, Justin Pryzby wrote:
>> On Tue, Jun 18, 2019 at 06:12:33PM -0500, Justin Pryzby wrote:
>> > A customers DB crashed due to OOM. While investigating the issue
>in our
>> > report, I created MV stats, which causes this error:
>> >
>> > ts=# CREATE STATISTICS sectors_stats (dependencies) ON
>site_id,sect_id FROM sectors;
>> > CREATE STATISTICS
>> > ts=# ANALYZE sectors;
>> > ERROR: XX000: tuple already updated by self
>> > LOCATION: simple_heap_update, heapam.c:4613
>>
>> > I'm guessing the issue is with pg_statistic_ext, which I haven't
>touched.
>> >
>> > Next step seems to be to truncate pg_statistic{,ext} and re-analyze
>the DB.
>>
>> Confirmed the issue is there.
>>
>> ts=# analyze sectors;
>> ERROR: tuple already updated by self
>> ts=# begin; delete from pg_statistic_ext; analyze sectors;
>> BEGIN
>> DELETE 87
>> ANALYZE
>
>Why this works seems to me to be unexplained..

There's no extended stats to compute after that, thus we don't try to update the extended stats twice.

Address
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-06-19 01:07:23 Tweaking DSM and DSA limits
Previous Message Adrian Klaver 2019-06-19 01:03:18 Re: psql UPDATE field [tab] expands to DEFAULT?