Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVcc7-0000Lb-Kt for pgsql-general@arkaria.postgresql.org; Wed, 20 Jun 2018 12:53:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVcc6-0008Hv-1i for pgsql-general@arkaria.postgresql.org; Wed, 20 Jun 2018 12:53:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVcc5-0008Hl-M4 for pgsql-general@lists.postgresql.org; Wed, 20 Jun 2018 12:53:29 +0000 Received: from mail-wr0-f177.google.com ([209.85.128.177]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fVcc1-0008NT-QE for pgsql-general@lists.postgresql.org; Wed, 20 Jun 2018 12:53:28 +0000 Received: by mail-wr0-f177.google.com with SMTP id h10-v6so3173247wrq.8 for ; Wed, 20 Jun 2018 05:53:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=GtFlyTp//lKsVgUBrxNpC+bsEVypL1nrfPvOtUPOa70=; b=aQaGIOUS1U1g6iw0JVMH/6SuTSTNTfXcxOx3VAlDTtzmfQEcAqzZqaPvkY71JFxoB+ NtzN+V1dTXnHnZLVzYHQh3m0/a/TXnx/VFCe+7PR+eeNdCori29bwiqAgGT6S4wMHCfP jqbu2A2Am+pakUS5xHY2iizGWhaIhQ+4Zq4BLEnxYFoeXe05VJi+aPLFUWBVEXMwClI2 nksuLJTrluRFpA+yu4o6D2B6ykZIh/Ld4DfCUmmycR2SGbbKC98IUCRguR16fsQAUciG DDG7qfyi9QxcWVQ8wL/t47U1ObLhSn990N/zP0IdYS0sAvni9q+Hvqm4lS6GLV4G52dI og+g== X-Gm-Message-State: APt69E29bJR25UhYMFytNP0YCStaNt8gu8qQjaZfJdsKodRzbMUzidGL UP12SqtT4oamfuzcmDBmCXPFGYBWSlvG9/BITQ== X-Google-Smtp-Source: ADUXVKLb5NQafjHJpRPOnoBlWgfiTFg6q7RBGeXuZu9aRLpZLdFNMFQbQIfNbMzl7Gu57r/WOWziFiaOGjIT5PAJ460= X-Received: by 2002:adf:91e5:: with SMTP id 92-v6mr17703525wri.124.1529499204047; Wed, 20 Jun 2018 05:53:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Geoff Winkless Date: Wed, 20 Jun 2018 13:53:13 +0100 Message-ID: Subject: Re: Suggestion about logging only every n-th statement To: vygen@kicktipp.de, pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000bdd84e056f1248a5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000bdd84e056f1248a5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 20 Jun 2018 at 12:51, Janning Vygen wrote: > But for analyzing usage patterns it would be very nice to have this > combined with a sample_rate for logging. > > logging_sample_rate =3D n > > So each n-th statement will get logged regardless of execution time. > I think you would need to introduce a randomizing element =E2=80=8Bif you w= anted to make it statistically valid. Logging every n'th statement could (depending on your usage pattern) be catastrophically inaccurate. Geoff --000000000000bdd84e056f1248a5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, 20 Jun 2018 at 12:51, Janning Vygen <vygen@kicktipp.de> wrote:
But for analyzing usage pa= tterns it would be very nice to have this
combined with a sample_rate for logging.

=C2=A0 =C2=A0logging_sample_rate =3D n

So each n-th statement will get logged regardless of execution time.

I think you would need to introduce a r= andomizing element =E2=80=8Bif you wanted to make it statistically valid. L= ogging every n'th statement could (depending on your usage pattern) be = catastrophically inaccurate.

Geoff
--000000000000bdd84e056f1248a5--