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 1nRD7C-0001Vb-NW for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Mar 2022 13:09:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nRD7B-0006DQ-6c for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Mar 2022 13:09:29 +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 1nRD7A-0006DG-Qz for pgsql-hackers@lists.postgresql.org; Mon, 07 Mar 2022 13:09:28 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nRD77-00012X-Ui for pgsql-hackers@lists.postgresql.org; Mon, 07 Mar 2022 13:09:28 +0000 Received: by mail-io1-xd2c.google.com with SMTP id c23so16954838ioi.4 for ; Mon, 07 Mar 2022 05:09:25 -0800 (PST) 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=yMmzxAcEmPH0kIfs31vINaIT2o6wAG+m434ZSsyr3NM=; b=TgDALOR+uIlKKWaUZhRc7r5NrBRu3kmCKb9EtKOfz75xF4xmlwLZedOwuBDu6qcfJh c4IQ/6SFgQ64PtDH5Q3b9dvTqY+dUDLAU7NG2iiFj8fFFs1OTgMde54l4E329di8bTWF ksiXDMOcNjyVkrpt8X1MrOcov5aqq1nxiWO9FH0oFgukUJlS/UKBrG1Nu3YlOXH89+FU ZUQ6YHE7SQvqJm+h27qRfIaJTIYb6Y97aqZnlFaXZBsfrMHcubjMhNSLzuaimmwSylW8 fGCPL2VGLFGWsV0D18jKlELPh/6fdfb3Pvy8xPkH3HSLzbZsHdYnQf/+/Hoepmwfv1Zi FUEQ== 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=yMmzxAcEmPH0kIfs31vINaIT2o6wAG+m434ZSsyr3NM=; b=yZmnpfr51EaPHmWn25QLD4M7710e2j2RmsfLRBwzUoK8x8Uv4WAbjRbiLPFJSdE+Lh RWlLFspdbS/0mYXFljMzZPbLxmro5QtoZ+q6+8zj4giokgSBIr1Ydz9XiMvyflwzyW/H f0U7PtStvxte9iwdypi1lqATe4QvmzZxE7/zRbwNhZFObldZSNfOT4VWePVK82hUzEMA xNeFdaSomKY2CRdhnSC7nB/aZYkxFmJDZKxrd6kmKWOurz84LckNtSEodowqFieZUrcx b+IwwuIFW5Q++H930JVq4/1n8tiOYCDnsl8ZXlrUewe0KiWkxQ26BJgBBb/SwgUrgcKm BRXg== X-Gm-Message-State: AOAM532aIJTkC50dATPk9qmFjKVQlpdNNF4/4LVVihVk3kJrWpZLkEN7 Gk6GJliopqto7TvhpQhzZO5WCQ== X-Google-Smtp-Source: ABdhPJwZKOSTHINdkurBQrgEUXitVXAA4s8rxYuJ4/nsrUca2nEF17zhr/+i/lcVclnsCK9k7XY3IQ== X-Received: by 2002:a02:cc26:0:b0:30f:ce14:5241 with SMTP id o6-20020a02cc26000000b0030fce145241mr10795526jap.94.1646658563916; Mon, 07 Mar 2022 05:09:23 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id v11-20020a056e02164b00b002c4a2d3d080sm10596168ilu.28.2022.03.07.05.09.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Mar 2022 05:09:23 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 9587C801860; Mon, 7 Mar 2022 07:09:22 -0600 (CST) Date: Mon, 7 Mar 2022 07:09:22 -0600 From: Justin Pryzby To: Magnus Hagander Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Add parameter jit_warn_above_fraction Message-ID: <20220307130922.GQ27651@telsasoft.com> References: <20220225162304.GD9008@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Mar 07, 2022 at 01:10:32PM +0100, Magnus Hagander wrote: > On Fri, Feb 25, 2022 at 5:23 PM Justin Pryzby wrote: > > > > I think it should be a NOTICE (or less?) > > Hmm. I'm not so sure. > > Other similar parameters often use LOG, but the downside of that is > that it won't be sent to the client. > > The problem with using NOTICE is that it won't go to the log by > default. It needs to be at least warning to do that. Anyone who uses this parameter is aleady going to be changing GUCs, so it doesn't need to work by default. The people who are likely to enable this already monitor their logs and have probably customized their logging configuration. > > Is it more useful if this is applied combined with log_min_duration_statement ? > > > > It's easy to imagine a query for which the planner computes a high cost, but > > actually runs quickly. You might get a bunch of WARNINGs that the query took > > 10 MS and JIT was 75% of that, even if you don't care about queries that take > > less than 10 SEC. > > Yeah, that's definitely a problem. But which way would you want to tie > it to log_min_duration_statement? That a statement would both have to > take longer than log_min_duration_statement *and* have JIT above a > certain percentage? In my experience that is instead likely to miss > most of the interesting times. I don't understand - why doesn't it combine trivially with log_min_duration_statement? Are you saying that the default / pre-existing min duration may not log all of the intended queries ? I think that just means the configuration needs to be changed. The GUC needs to allow/help finding these JIT issues, but going to require an admin's interaction in any case. Avoiding false positives may be important for it to be useful at all. Hmm .. should it also combine with min_sample_rate ? Maybe that addresses your concern. -- Justin