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 1o7QfQ-0000Tt-RW for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Jul 2022 00:07:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o7QfP-0004An-EX for pgsql-hackers@arkaria.postgresql.org; Sat, 02 Jul 2022 00:07:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7QfP-0004Ae-5F for pgsql-hackers@lists.postgresql.org; Sat, 02 Jul 2022 00:07:19 +0000 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7QfE-0003fu-6W for pgsql-hackers@postgresql.org; Sat, 02 Jul 2022 00:07:17 +0000 Received: by mail-qk1-x729.google.com with SMTP id g1so2947520qkl.9 for ; Fri, 01 Jul 2022 17:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oKLZA3iTZN1rHFLAjF59PC0Ho+O5F1GPENwrF9yAWfs=; b=ac4BZ+EIC9tm3B9ypSa9kyPvkQEzJEGHLR2/UGctL99AKjDgieh88A/OK5nBLqylbk XecysrBqMEuH4JAzJwAz38qgCbHqoBi2gSgj4VRUU17yfcbdglBL2g/GzPa5cfWjki6/ 11QcwOe0pQZehug9RHN6fTuHQuFm9u1ttIbwQw0Y+5Nbo7hzqY04CLwqC56In7bDtyeC aSSMppgQWMsQekAuceHt/BUgDuFgPbrokud9JS7W5+kDOmyRtFPy1SLlhY8cn5ZF8d+f mCAArxk1On0MOPQegsIAfE9ciXb4xhA0lr6loBWJKtH60nXn1UxjCEhDRpoj0Vxl8eS7 1cRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oKLZA3iTZN1rHFLAjF59PC0Ho+O5F1GPENwrF9yAWfs=; b=lGI8DcgasPsWG0Fjo/mBIAmuL+rNfgjva4KR7VnjBuPxESbB5A+ExQ0gQ9yJew3IVT GJKZISPQ31lJ6ey4MCv3SBo1GdLZQYkSUnGbBd9In2bKI1IuR83Lx4RVsXwf18xCTQUe Eatp8ueImcLC1KPgNSSPfOHQ7B1oPCGFjwzh8D2ErU5ynV5ceTcdV1OKJtGIbNrM2IQ2 DkkDubWGqojovLfLV9igTQvt4uqt2UrNFNxeVl22HGNvDIGUDe1Sl8mXv40+C/W7u9d2 Rsl6QwYtVCQ4KzwJFc9k3KNbGBKJI18YP2HHhGdUE6qP4OcnmDEgl91uanV1BmavcX6R FoqA== X-Gm-Message-State: AJIora+lNzSzbdLkPlTFVNkU2oDsE1YNQl9rcbGCW3M8pIiX84lUmt81 tySaiDxguPVYzWQuGg6Omq8hLQ== X-Google-Smtp-Source: AGRyM1uKfIrUSNPPjmpFNIpMK3a219x8W5SWDuhc9ULe1ZT+5L50WOnV4HL1KUzilvzZUNzDfWIesA== X-Received: by 2002:a37:a08e:0:b0:6ae:f3d0:ab41 with SMTP id j136-20020a37a08e000000b006aef3d0ab41mr12404163qke.274.1656720426022; Fri, 01 Jul 2022 17:07:06 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id b14-20020ac84f0e000000b00317c3ce1f4esm15227920qte.45.2022.07.01.17.07.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jul 2022 17:07:05 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id BFFF3800740; Fri, 1 Jul 2022 19:07:04 -0500 (CDT) Date: Fri, 1 Jul 2022 19:07:04 -0500 From: Justin Pryzby To: Tom Lane Cc: Michael Paquier , Robert Haas , Tomas Vondra , pgsql-hackers@postgresql.org Subject: Re: should check interrupts in BuildRelationExtStatistics ? Message-ID: <20220702000704.GJ13040@telsasoft.com> References: <20220509000108.GQ28830@telsasoft.com> <3592964.1652067393@sss.pgh.pa.us> <20220603152837.GO29853@telsasoft.com> <20220605014233.GR29853@telsasoft.com> <20220617222549.GI29853@telsasoft.com> <154878.1656717551@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <154878.1656717551@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jul 01, 2022 at 07:19:11PM -0400, Tom Lane wrote: > I tried interrupting at a random point and then stepping, and > look what I hit after just a couple of steps: I'd come up with the trick of setting SET backtrace_functions='ProcessInterrupts'; > That, um, piqued my interest. After a bit of digging, > I modestly propose the attached. I'm not sure if it's > okay to back-patch this, because maybe someone out there > is relying on qsort() to be incapable of throwing an error > --- but it'd solve the problem at hand and a bunch of other > issues of the same ilk. Confirmed this fixes the 3 types of extended stats, at least for the example cases I made. If it's okay to backpatch, v14 seems adequate since the problem is more prominent with expressional statistics (I'm sure that's why I hit it) ... otherwise v15 would do. -- Justin