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 1nNd2V-0000WC-Nr for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Feb 2022 16:01:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nNd2T-000636-PF for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Feb 2022 16:01:49 +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 1nNd2T-00062x-Ec for pgsql-hackers@lists.postgresql.org; Fri, 25 Feb 2022 16:01:49 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nNd2R-00048h-2d for pgsql-hackers@lists.postgresql.org; Fri, 25 Feb 2022 16:01:48 +0000 Received: by mail-pj1-x102d.google.com with SMTP id j10-20020a17090a94ca00b001bc2a9596f6so5164868pjw.5 for ; Fri, 25 Feb 2022 08:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mnCnQLDc+WB84kwETbXOeQ6EJCOuhQORknCgaxCn80M=; b=RMkiMtyZ5TbMf2jY8mwAAeuBbiDy7AvDINIJWSJFOJK5/HWq5scbRSN/ZFEE4wUBP5 Ni/GzMk9N0uO6iZrtwGEd31CISdyLJTsvrNwff/PhFKGWzn1Tu4dd78l/T7xeQ/uk7Tm M322a9/O77W0RrDYGolqamR4uaLo+W2aCesoPEUbhXXBIf5mjOXtDo1UpM/n2LheYz9G Mpz8A9GGGgXrOIA5QhK6VC0P/p3SftpskPL0+3M62rp/A5d7kDIJzQLSDPJr3weXcllX jTa/6Q6vlMQQrSeyK8AeLTdBVWaqJEjzdt2O5xI7h9TC8ID5+s/I93pGpiT0mBBrIPkB qd4A== 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; bh=mnCnQLDc+WB84kwETbXOeQ6EJCOuhQORknCgaxCn80M=; b=KLwS9D6eHzG85E29PjIJ0cmUD1Y1PcSZHIfoDTnp/0WBT5evXGOznnBLoV4SywXTV5 w6AA6c24npjiHiO50jEt0cRc9yE+69tXyfjVp055+GkdNX8K2rotYNq5lEJDdNGutKFQ 6x36S4FqaFXLe42+iQ+kbDNDL2Mvza7a0pUdljKYjkqhMXP+FFu25Z5shcyqAJbOKDvk Oj/m0q0jtsWNtuRkvj06F/9+CnApd8VsMUM7FUHD70R3dz9pRqMk2juRaro7oR4xXqcA WfO+MDU62HRY7j5lpzuQIrdHw2VdxXWN9GqcGfzIEPcDUaIs7OBrXS7tCoanJcPo+pkA MhLA== X-Gm-Message-State: AOAM532l2fWhPGvpZg0xwmhihAnTrBn9rHTJAunvO091l/z3+uJRSfEl 6AE4iI9YbZMmPd/YN2XBLVw= X-Google-Smtp-Source: ABdhPJy1a0l4IzB8PDKqiImjp/fnkioIBu5fCTmHkFsKy5M6bEGqAj8b/lJq2yutNlvc3FvxFgBb7w== X-Received: by 2002:a17:902:aa8d:b0:150:c60:29a4 with SMTP id d13-20020a170902aa8d00b001500c6029a4mr8186528plr.40.1645804906028; Fri, 25 Feb 2022 08:01:46 -0800 (PST) Received: from jrouhaud (2001-b011-1005-9344-f455-3efb-d76f-9e4c.dynamic-ip6.hinet.net. [2001:b011:1005:9344:f455:3efb:d76f:9e4c]) by smtp.gmail.com with ESMTPSA id t29-20020a63225d000000b0035e366803dasm2995191pgm.45.2022.02.25.08.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 08:01:45 -0800 (PST) Date: Sat, 26 Feb 2022 00:01:41 +0800 From: Julien Rouhaud To: Magnus Hagander Cc: PostgreSQL Developers Subject: Re: Add parameter jit_warn_above_fraction Message-ID: <20220225160141.k35qjyysclouw5xc@jrouhaud> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Feb 25, 2022 at 04:16:01PM +0100, Magnus Hagander wrote: > This patch adds a configuration parameter jit_warn_above_fraction that > will cause a warning to be logged if the fraction of time spent on > doing JIT is bigger than the specified one. For example, this can be > used to track down those cases where JIT ends up taking 90% of the > query runtime because of bad estimates... I think that's tremendously useful, huge +1. Just a few minor nit: + A value of 0 (the default)disables the warning. missing space + ereport(WARNING, + (errmsg("JIT time was %ld ms of %d ms", + jit_time, msecs))); "JIT time" may a bit obscure for users, how about "JIT total processing time"?" + gettext_noop("Sets the fraction of query time spent on JIT before writing" + "a warning to the log."), + gettext_noop("Write a message tot he server log if more than this" + "fraction of the query runtime is spent on JIT." + "Zero turns off the warning.") missing spaces in the concatenated strings. The rest of the patch looks good to me.