Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdOcj-00049u-5t for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2019 00:38:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hdOcg-00021m-WB for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2019 00:38:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdOcg-00021f-Jn for pgsql-hackers@lists.postgresql.org; Wed, 19 Jun 2019 00:38:46 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdOcZ-0001Uo-7n for pgsql-hackers@postgresql.org; Wed, 19 Jun 2019 00:38:45 +0000 Received: by mail-io1-xd31.google.com with SMTP id k8so4010701iot.1 for ; Tue, 18 Jun 2019 17:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kM4xZ59ewr9iJFNTEJDdbnnkpBLgcWNZSC3CWYhhneI=; b=phMcR6EavScZI6vnzYXzsjBB2U5wgjM+4rftRNlEQ1n3P/UYxoK/KeaSRP1CTvE0W2 vmy3I9PbDio2bTzANDl1zVcCF3C19V326WNOzYWiQvoTmFJRIYmrKSt691iqwvoVCCyR AdA5FGkz15upNXHg2I9FboQ1/8jEzIYJJUoPcvOe1P11LsIOO3upbd1zD+qKVGYXzlhI 4CqWQeMNlDq9iK6kwWuuZpMDeLEDZuUloEw5VrU+sBus515UvRUeR5B1UXnvd6KmZOkp GTShKm5uyZs464eUBW+i3dc1Vl8iidC2qSD49P2O4XzNBILV7mEJGom7RxpNi7VGz8zL Qjtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kM4xZ59ewr9iJFNTEJDdbnnkpBLgcWNZSC3CWYhhneI=; b=caWl+4GKmVpf8ZI+TOg47ciHaFMekKwU8ICKT0YrBe/GiA6WTSXGQaHl2EqrBz9c8G Rh3uDW9SHhoFqWBVD+920hGy5biTkuxI5l8+wJMapmS/jpZyWmW3ZpPyDi/LJyjziTz9 /0AzcfGc1aa83yJ0zIxSSAAcQBbOZRd85PUqVNksdGcq0dPMkRd5I/jarGlP/oYMm7wN 1DFkuUDBdjBnv4ikCweGT76IGqSN2y0tvOpNfwoik8YQoJel6M/jomQPLkADYLnG+gtj Vu0YSUfvfMnw9zPU3VfD2itokfvtRqnOXoKIa4u+3wH7Rjadpk2NyXY7yK81Ro1Qt8SY jC+w== X-Gm-Message-State: APjAAAV+q11G+Cr3OUDcvSHoUWRNE05ox+S4BZtMd94gguMbD8ghMidH Np6rrW3/ovmqvjr4mjCs01ps+zoi8oo= X-Google-Smtp-Source: APXvYqz3ZVHNcg8pOdXlFUE6bxph3vRz+fkeWEDBGhOX76RvQa2g5NNvwAPnawT7EET/8fNeLDOkSQ== X-Received: by 2002:a5d:8506:: with SMTP id q6mr14776170ion.41.1560904716883; Tue, 18 Jun 2019 17:38:36 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id q1sm15534825ios.86.2019.06.18.17.38.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 17:38:36 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id E9CAA800A33; Tue, 18 Jun 2019 19:38:34 -0500 (CDT) Date: Tue, 18 Jun 2019 19:38:34 -0500 From: Justin Pryzby To: pgsql-hackers@postgresql.org Subject: Re: ANALYZE: ERROR: tuple already updated by self Message-ID: <20190619003834.GA11006@telsasoft.com> References: <20190618231233.GA27470@telsasoft.com> <20190618234858.GK16019@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618234858.GK16019@telsasoft.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.. Justin