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 1nnqpx-0002DX-I0 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 May 2022 00:01:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nnqpv-0007kV-M8 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 May 2022 00:01:15 +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 1nnqpv-0007kM-Ah for pgsql-hackers@lists.postgresql.org; Mon, 09 May 2022 00:01:15 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nnqps-0005h4-DG for pgsql-hackers@postgresql.org; Mon, 09 May 2022 00:01:14 +0000 Received: by mail-qk1-x735.google.com with SMTP id a22so9745600qkl.5 for ; Sun, 08 May 2022 17:01:11 -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:mime-version:content-disposition :user-agent; bh=Qy+1iC01OS24/wFsEVI0pojxy0IjurXdNO0IbU3E4K8=; b=OBd/VMw8teB247I/2QNz06Lfr68uBVJU3e5vWasz1lQL8ZmduI2T0d/jHC3rfuOiqS LJwAQIoJGzFDfuuxvL42ro/pjtHjsbkm1t2+gfDUDvTjDMj7tpmVsL+igssqcCSd9Xpu PyU+yGeJqwNLOT3IICE1/or4PWIhpFIhD2Avbua59o9piIAFtIP7eCeidTHlAYU3F3qc BRShAlnJK6RHq8czF4bJLjtVCuNiVYR6b57vRmWK59N3J4ZVj1UlGS9ChJznYSQLX4MO MD/SfJXmUJVfn0IoRg4CU7UoUF4XF3+x9j+//zA5B94ouM3EXCAANN0hGnjIn3FGcCyz 0o2A== 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:mime-version :content-disposition:user-agent; bh=Qy+1iC01OS24/wFsEVI0pojxy0IjurXdNO0IbU3E4K8=; b=I9M89oID5+ZNyils9YxhCZbRwfFz+9OQ00ogwUlY2/Xr+sn5TJmuAz23WyOdi6q2z7 xsFjmVNJwFhlqhfvil+O1gQO5dPuwO1KhFfPiDXZ2L7RQGpZ2ef7Shw/iMQ1pNtOgEqC 4kP3Cd9je0snsUOZXGNmtUsKF3lJj7baEaojK9VNyo2rXxkVCXE2sA5L2Dth4Tpvj6Hi 5QI2pE2N9+qBrucJQxQ+RxJIs4w1d9zJyUSQvnNFQl1BZhl/+R3ifVckwEGkJCgiQogO RqHagiqEN2t93KZLa0h/FPNugkmS/PFH69D4ftaJkhZ06/Qs6ETEbwhugkBofUAeM2vl MJlA== X-Gm-Message-State: AOAM533qIjwRGzLxWzbLeYv1KjDW9cCpKBK+DV7q5e/tY2n2nBbOMj2f G9sffTtWc4tgZoEH5Zdey7zmag== X-Google-Smtp-Source: ABdhPJzjQu+NGS+UDey+nCORkK5Pn9WsZYmbzFJ8Dar7DGEAoqaxb1ihFJe/TjAYKp4b+X4bAeDKLw== X-Received: by 2002:a37:9bce:0:b0:69f:a640:7297 with SMTP id d197-20020a379bce000000b0069fa6407297mr10017926qke.497.1652054469996; Sun, 08 May 2022 17:01:09 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a142-20020a376694000000b0069fc13ce1dasm6239885qkc.11.2022.05.08.17.01.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 May 2022 17:01:09 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id ED845800567; Sun, 8 May 2022 19:01:08 -0500 (CDT) Date: Sun, 8 May 2022 19:01:08 -0500 From: Justin Pryzby To: Tomas Vondra Cc: pgsql-hackers@postgresql.org Subject: should check interrupts in BuildRelationExtStatistics ? Message-ID: <20220509000108.GQ28830@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Restarting a large instance took twice as long as I expected due to not checking interrupts in (at least) statext_ndistinct_build. Long enough that I attached (and was able to attach) a debugger to verify, which I think is too long. I think it could cause issues for an high-availability cluster or other script if it takes too long to shut down. The tables being auto-analyzed have 9 exteneded stats objects, each with stats target=10. 7 of those are (ndistinct) stats on 4 simple columns plus 1 expression (5 total). And the other 2 stats objects are expressional stats (necessarily on a single expression).