Re: ANALYZE: ERROR: tuple already updated by self

2019-07-30 Thread Tomas Vondra
On Mon, Jul 29, 2019 at 12:18:33PM +0200, Tomas Vondra wrote: On Sun, Jul 28, 2019 at 09:53:20PM -0700, Andres Freund wrote: Hi, On 2019-07-28 21:21:51 +0200, Tomas Vondra wrote: AFAICS it applies to 10+ versions, because that's where extended stats were introduced. We certainly can't mess

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-29 Thread Tomas Vondra
On Sun, Jul 28, 2019 at 09:53:20PM -0700, Andres Freund wrote: Hi, On 2019-07-28 21:21:51 +0200, Tomas Vondra wrote: AFAICS it applies to 10+ versions, because that's where extended stats were introduced. We certainly can't mess with catalogs there, so this is about the only backpatchable fix

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-29 Thread Tomas Vondra
On Mon, Jul 29, 2019 at 10:15:36AM +0100, Dean Rasheed wrote: On Sun, 28 Jul 2019 at 11:15, Tomas Vondra wrote: Attached is a patch fixing the error by not building extended stats for the inh=true case (as already proposed in this thread). That's about the simplest way to resolve this issue

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-29 Thread Dean Rasheed
On Sun, 28 Jul 2019 at 11:15, Tomas Vondra wrote: > > Attached is a patch fixing the error by not building extended stats for > the inh=true case (as already proposed in this thread). That's about the > simplest way to resolve this issue for v12. It should add a simple > regression test too, I

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-28 Thread Andres Freund
Hi, On 2019-07-28 21:21:51 +0200, Tomas Vondra wrote: > AFAICS it applies to 10+ versions, because that's where extended stats > were introduced. We certainly can't mess with catalogs there, so this is > about the only backpatchable fix I can think of. AFAIU the inh version wouldn't be used

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-28 Thread Tomas Vondra
On Sun, Jul 28, 2019 at 09:42:44AM -0700, Andres Freund wrote: Hi, On 2019-07-28 12:15:20 +0200, Tomas Vondra wrote: Attached is a patch fixing the error by not building extended stats for the inh=true case (as already proposed in this thread). That's about the simplest way to resolve this

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-28 Thread Andres Freund
Hi, On 2019-07-28 12:15:20 +0200, Tomas Vondra wrote: > Attached is a patch fixing the error by not building extended stats for > the inh=true case (as already proposed in this thread). That's about the > simplest way to resolve this issue for v12. It should add a simple > regression test too, I

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-28 Thread Tomas Vondra
On Tue, Jul 23, 2019 at 01:01:27PM -0700, Andres Freund wrote: Hi, On 2019-06-18 17:08:37 -0700, Andres Freund wrote: On 2019-06-18 18:48:58 -0500, Justin Pryzby wrote: > Ah: the table is an inheritence parent. If I uninherit its child, there's no > error during ANALYZE. MV stats on the

Re: ANALYZE: ERROR: tuple already updated by self

2019-07-24 Thread Andres Freund
Hi, On 2019-06-18 17:08:37 -0700, Andres Freund wrote: > On 2019-06-18 18:48:58 -0500, Justin Pryzby wrote: > > Ah: the table is an inheritence parent. If I uninherit its child, there's > > no > > error during ANALYZE. MV stats on the child are ok: > > It's a "classical" inheritance parent,

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Andres Freund
y 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. >> >> Confi

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Justin Pryzby
essing 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 f

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Peter Geoghegan
On Tue, Jun 18, 2019 at 5:09 PM Andres Freund wrote: > > It might be interesting to set a breakpoint within heap_update(), > > which is called by simple_heap_update() --technically, this is where > > the reported failure occurs. From there, you could send an image of > > the page to the list by

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Tom Lane
Andres Freund writes: > I think the problem is pretty plainly that for inheritance tables we'll > try to store extended statistics twice. And thus end up updating the > same row twice. They shouldn't be the same row though. If we're to try to capture ext-stats on inheritance trees --- and I

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Andres Freund
Hi, On 2019-06-18 17:00:09 -0700, Peter Geoghegan wrote: > On Tue, Jun 18, 2019 at 4:49 PM Justin Pryzby wrote: > > Sure: > > > > (gdb) bt > > #0 errfinish (dummy=0) at elog.c:414 > > #1 0x0085e834 in elog_finish (elevel=, > > fmt=) at elog.c:1376 > > #2 0x004b93bd in

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Andres Freund
Hi, On 2019-06-18 18:48:58 -0500, Justin Pryzby wrote: > Ah: the table is an inheritence parent. If I uninherit its child, there's no > error during ANALYZE. MV stats on the child are ok: It's a "classical" inheritance parent, not a builtin-partitioning type of parent, right? And it contains

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Peter Geoghegan
On Tue, Jun 18, 2019 at 4:49 PM Justin Pryzby wrote: > Sure: > > (gdb) bt > #0 errfinish (dummy=0) at elog.c:414 > #1 0x0085e834 in elog_finish (elevel=, > fmt=) at elog.c:1376 > #2 0x004b93bd in simple_heap_update (relation=0x7fee161700c8, > otid=0x1fb7f44, tup=0x1fb7f40) at

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Justin Pryzby
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: > > ts=# ANALYZE sectors; > > ERROR: XX000: tuple already updated by self > > LOCATION: simple_heap_update, heapam.c:4613 > Ah: the table is an inheritence parent. If

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Justin Pryzby
t} 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 On Tue, Jun 18, 2019 at 04:30:33PM -0700, Andres Freund wrote: > Any chance to get a backtrace for th

Re: ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Andres Freund
Hi, On 2019-06-18 18:12:33 -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

ANALYZE: ERROR: tuple already updated by self

2019-06-18 Thread Justin Pryzby
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