Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSPve-0002vz-GU for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Nov 2019 18:21:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSPvd-0004X2-7S for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Nov 2019 18:21:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSPvc-0004Wv-SE for pgsql-hackers@lists.postgresql.org; Wed, 06 Nov 2019 18:21:13 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iSPvZ-0001my-IU for pgsql-hackers@lists.postgresql.org; Wed, 06 Nov 2019 18:21:11 +0000 Received: by mail-wr1-x429.google.com with SMTP id f2so18241303wrs.11 for ; Wed, 06 Nov 2019 10:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=N6LaOSDI4NVkHYunl8ckBiz/SyvpXfP5d+fta0jEAao=; b=RSrXIkrdt5XETSNeKJJC91tGOTScFbLY9MS/fjSaFosmCG1i2hlvCns5Cj57kdqFST JFrk+W8nGg9xG6x8BYjbVOgXUyPhu4cqvIK0qevBT7+aVINFSAZDAhw+oZdiUurxE/SJ RaDE9NrubQISsMop6gH0cpOzASQHvj+PyOSb/n080m97PGj0l6HujVUl36poF3TU7NTc 0Z7mlDE1t83zoSKcuBc8Xacy59CfHbSzTR/G3nfchiBJK+5uvJk01FsmNB06kikqSngL Zb2NzrbLbfORV978oeEFamnSTr9uEM7jCvSVzNgD8/TVZAJbR/DR8m/N2bneuLyGAXkw 6g0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=N6LaOSDI4NVkHYunl8ckBiz/SyvpXfP5d+fta0jEAao=; b=LTIn2yPuTlV+QV/POtB/kfmnV7Oyn/SvLuGa0oAelQHMsOjrlVMpz7FbQryMgN5n3g 4/QbekC3uyIUOxB9Tq+WNJpH9IG26RK1qVLtgspOvbdfFGtph/eMpulSK7iu3DE7CiS/ 2waFou0GB+btxX7mm/5FyKJWj9fPHGISbE21CflRQkdEUnHw0oD1M7ju6jbYsL3RjQXp hg2fvuA4hU1Nh2K5R5gOq0vPL2fSAagmRLEOW+1g2c6TCm/Jn1HKJwRuWMZvSZAemcda KsSwlzHhDBPJjREKZeoLF3LZsXuhaUTZpJ5lcwNRxG0+jZhy5HutyY7e/nwFdwNDk6p4 sPiA== X-Gm-Message-State: APjAAAWWOO1M5XMbNrtWvEftdmDL1ovDDcrnoX8sa2XyzJ18MzNpi3eh pYjj5G8L1mk5kCFkFJucDSm6KQ== X-Google-Smtp-Source: APXvYqzxE3AY6bt3t3vO3AfR7ZXrWnMR6H0GRMwr6scmwWol5OibNEoUpOIOJqcAZjMh+R5faI9Vqg== X-Received: by 2002:adf:8b09:: with SMTP id n9mr3768458wra.95.1573064468054; Wed, 06 Nov 2019 10:21:08 -0800 (PST) Received: from localhost (ip-86-49-253-183.net.upcbroadband.cz. [86.49.253.183]) by smtp.gmail.com with ESMTPSA id l4sm3282315wml.33.2019.11.06.10.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 10:21:07 -0800 (PST) Date: Wed, 6 Nov 2019 19:21:06 +0100 From: Tomas Vondra To: Tom Lane Cc: Adrien Nayrat , pgsql-hackers@lists.postgresql.org Subject: Re: idea: log_statement_sample_rate - bottom limit for sampling Message-ID: <20191106182106.dwdvxalewyydqbx3@development> References: <4540bafe-1b23-a6ce-a313-f3b03bb418df@anayrat.info> <20190801100445.yo5v3pdxelijztzm@development> <3f6b75ea-03bb-7c35-1f20-e989f4b7f9ac@anayrat.info> <20190804191037.em6rmlvxjpcsjtqu@development> <25079.1564946172@sss.pgh.pa.us> <20190804195823.qi7vntgybfgitdnn@development> <27954.1564950312@sss.pgh.pa.us> <20190804204848.7f7ypsbijpgxojxx@development> <20190804214154.tbr5pbg5wss2adfu@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190804214154.tbr5pbg5wss2adfu@development> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Aug 04, 2019 at 11:41:54PM +0200, Tomas Vondra wrote: >On Sun, Aug 04, 2019 at 10:48:48PM +0200, Tomas Vondra wrote: >>On Sun, Aug 04, 2019 at 04:25:12PM -0400, Tom Lane wrote: >>>Tomas Vondra writes: >>>>On Sun, Aug 04, 2019 at 03:16:12PM -0400, Tom Lane wrote: >>>>>Isn't the issue here the interaction between log_transaction_sample_rate >>>>>and log_min_duration_statement? >>> >>>>No, that interaction only affects statement-level sampling. >>> >>>OK, I was confusing the features. >>> >>>>For transaction-level sampling we do the sampling independently of the >>>>statement duration, i.e. we when starting a transaction we determine >>>>whether the whole transaction will be sampled. It has nothing to do with >>>>the proposed log_statement_sample_limit. >>> >>>So, to clarify: our plan is that a given statement will be logged >>>if any of these various partial-logging features says to do so? >>> >> >>Yes, I think that's the expected behavior. >> >>- did it exceed log_min_duration_statement? -> log it >>- is it part of sampled xact? -> log it >>- maybe sample the statement (to be reverted / reimplemented) >> >>>(And the knock on HEAD's behavior is exactly that it breaks that >>>independence for log_min_duration_statement.) >>> >> >>Yeah. There's no way to use sampling, while ensure logging of all >>queries longer than some limit. >> > >FWIW I've reverted the log_statement_sample_rate (both from master and >REL_12_STABLE). May the buildfarm be merciful to me. > >I've left the log_transaction_sample_rate in, as that seems unaffected >by this discussion. > I've pushed the reworked version of log_statement_sample_rate patch [1]. If I understand correctly, that makes this patch unnecessary, and we should mark it as rejected. Or do we still need it? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services