Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaP0o-0001XU-Kw for pgsql-committers@arkaria.postgresql.org; Mon, 19 Sep 2022 22:13:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oaP0n-0006G9-3i for pgsql-committers@arkaria.postgresql.org; Mon, 19 Sep 2022 22:13:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaP0m-0006G0-T5 for pgsql-committers@lists.postgresql.org; Mon, 19 Sep 2022 22:13:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaP0h-0008Fs-Rd for pgsql-committers@lists.postgresql.org; Mon, 19 Sep 2022 22:13:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 28JMCxdC537760; Mon, 19 Sep 2022 18:12:59 -0400 From: Tom Lane To: Alvaro Herrera cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Add support for MERGE SQL command In-reply-to: References: Comments: In-reply-to Alvaro Herrera message dated "Mon, 28 Mar 2022 14:48:29 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <537758.1663625579.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 19 Sep 2022 18:12:59 -0400 Message-ID: <537759.1663625579@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Add support for MERGE SQL command komodoensis just failed in a way that demonstrates instability of the MERGE tests [1]. It looks to me like a background autovacuum came along and processed one or both of ex_msource and ex_mtarget, causing their default join plan to change to something else. Probably an explicit ANALYZE would serve to stabilize that, but it might end up with a slightly different plan than what we have now. It's not clear if that matters? I also wonder whether we'd need to re-analyze after each of the explain_merge calls, because those are changing the tables and hence potentially provoking background stats updates. It might be better to change these to temp tables. You'd then have to filter the temp schema out of the results; but since you have a filtering function anyway, that doesn't seem too hard. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dkomodoensis&= dt=3D2022-09-19%2011%3A32%3A56