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 1huOGR-0005r2-5v for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Aug 2019 21:42:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1huOGP-0001pK-Tv for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Aug 2019 21:42:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huOGP-0001pD-L6 for pgsql-hackers@lists.postgresql.org; Sun, 04 Aug 2019 21:42:01 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huOGM-0005hj-TI for pgsql-hackers@lists.postgresql.org; Sun, 04 Aug 2019 21:42:01 +0000 Received: by mail-wr1-x441.google.com with SMTP id x4so29241447wrt.6 for ; Sun, 04 Aug 2019 14:41:58 -0700 (PDT) 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=QaoCN6+tY0pohDEMKKil70KceWe1kkUWuZ/ICdX3bx0=; b=ChN0KpLesThI5+FgsXi+pqRADgg6DKuVrjjX3U3eHRTMGO8jVovkihdqYaBUmbG2d7 A/XnlZkZS7mOX2JidbKCeCjHXGjc2PkrEQ5ag7RqFUZTakIaEaIbFu8Se2Qa+EGIzjsj fj5ghqcgel8ivBqzMtedsJ6/85vtfDJflltezdRpDxreIHWBiYtdeFrjM0CgFJ9XyCuJ Y7Qj29a4wf0Vpsmniz7F8kQ7G/jdzI+999ubQ8oTv9UVhghefVotr+FbaHIOXIFvXtln 4WxhbUvCkgam9cJ7JhruWTa+suNeTMkKwvvpLnY+Fbuc7WSEF7fU5e1GFgkLcYwO7sK1 F8QQ== 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=QaoCN6+tY0pohDEMKKil70KceWe1kkUWuZ/ICdX3bx0=; b=J6QfZ6757Xk3gcl9Qo9zSH4jGl/DBipNrN6EAzv9/ZI2qaqjkADSMDcxqVVpdEsjk+ 6lhg8lpwABOh7LytGTo+tKfiP31WA/5eeWUX4RpMc0pFGpAen1DIhwC9soQ04mB9NDTr +6cOZ2IfJw0AZf/dbwnjEAiR5CiDnbQbuEGDYZI+tY4DSDju1RXrcY/V0FBwxaLzmYZQ /Ebww/KCd72Drh6/OivRhF+44RrF1oM86lgRpYXJUil8GkiAgapGM3KEZmQ4GZmbTE8w hp07fHOQD3736I+TreeHK+sjWSrheD6WAR2F6ZW5RlVuIRR0mLiz+WlEcD/1Lp8xOnSa 7cAw== X-Gm-Message-State: APjAAAV/MBoPdzxJGrEkgaCR8ZQQVF6c5VfiQU7Ek2LTxZKSxREzQtMI 6W5+G8CN2iYlFl3DxIcBW9GY6Q== X-Google-Smtp-Source: APXvYqyCvACHoAPYVl0d/A4BWScdQicmj+HfGoUifTAasL5GkWupjFUyX4ThymU/+/rkwsnQbtZ3CA== X-Received: by 2002:adf:f28a:: with SMTP id k10mr81770752wro.343.1564954916526; Sun, 04 Aug 2019 14:41:56 -0700 (PDT) Received: from localhost (ip-86-49-253-160.net.upcbroadband.cz. [86.49.253.160]) by smtp.gmail.com with ESMTPSA id p63sm32858858wmp.45.2019.08.04.14.41.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 14:41:55 -0700 (PDT) Date: Sun, 4 Aug 2019 23:41:54 +0200 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: <20190804214154.tbr5pbg5wss2adfu@development> References: <20190727221948.irg6sfqh57dynoc7@development> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190804204848.7f7ypsbijpgxojxx@development> User-Agent: NeoMutt/20180716-1444-295967 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services