Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qnbAe-00BOaw-RH for pgsql-general@arkaria.postgresql.org; Tue, 03 Oct 2023 08:54:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qnbAd-002vHw-AS for pgsql-general@arkaria.postgresql.org; Tue, 03 Oct 2023 08:54:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qnbAc-002vHS-S2 for pgsql-general@lists.postgresql.org; Tue, 03 Oct 2023 08:54:23 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qnbAa-007wfH-OF for pgsql-general@lists.postgresql.org; Tue, 03 Oct 2023 08:54:21 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-32487efc319so701980f8f.1 for ; Tue, 03 Oct 2023 01:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1696323259; x=1696928059; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=V6P/DX1RmLmLzHeaw7tuDFl/68lT4bOdbWTvY9z/Eyo=; b=naGxFEbLqCBAVl9IUNhjool8e6aK65FbI3SVp1Mz5UUfK0kLF5HzfQV/Eo/bhwaBaS p0DUtWkI/mrI+R8z5mJHpojQfAdDzjs0I9BO2xgeAJo2W3WU2KR5xhofOPOXNCYeehAa V+Wzt6e0YHQxqn+AGi7hTltvuIXB7TDXpEFtfBtCfx2h+uIioLkNqtn0Fl+Z3Iap1cbS 3VpKAE4A7b4m1qSMzCmTkWRF4mNsY70R9DItNWpJ3wfDhp8pLo0KCON2w0oZE+wcW134 aOBvISBtEvPKHOwQ2P6G9HtgYldJEHbYrc0TxgSpkf2XqGYXbl6nfiqH368sSBotgnOT YwOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696323259; x=1696928059; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=V6P/DX1RmLmLzHeaw7tuDFl/68lT4bOdbWTvY9z/Eyo=; b=DWKuf2zJy3g5gUiEHwrVRe13Dtl+Z0ekxzYZH6BJaPLiLfOUzzrn7ZMBcLwcVBAQVa hOosAVWeen1Z1TTynuP5r+bZi98w8wk4srHf8f5oOSM6M68azjJKsqmFMTAyJYHIPqPG tZtKQ9FmmsUyqjdsuOy8u6UOBSid0UGvlkc2wIcpTOAnuRnYepuWwUGOd39oLHlSFLx+ PTi/LG7ZymKMqRHef3zfyoPnXTFCfDfMcvfcpqhaOPKBfIhc3BiabM0t+Nnw9dW2cfH2 cJbQhRUAdcBTktXfjGG+FiE2CDgAs2MbA+FA2pRrv1oDTJR29ohnxmRwihr4aofWD0A7 2ewQ== X-Gm-Message-State: AOJu0YwrFD2ACh11o+0R44vDEUOThPwDeggRn4s0oF+gJrl5v0d9JLWP Xdea66MW+T8K4u98O1ujJcZ3Pg== X-Google-Smtp-Source: AGHT+IFD6DiXHwTSbM+999NDoNyvYBo/cilJnQjqWUN1YthQfrS0/gnjNx6eUhRTGqw28poVNe4BuQ== X-Received: by 2002:a05:6000:11ca:b0:31f:fe14:d2f7 with SMTP id i10-20020a05600011ca00b0031ffe14d2f7mr11371287wrx.4.1696323258879; Tue, 03 Oct 2023 01:54:18 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:1c0:45b9:97:dde5:9bad]) by smtp.gmail.com with ESMTPSA id e11-20020a056000194b00b0032320a9b010sm1062451wry.28.2023.10.03.01.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 01:54:18 -0700 (PDT) Message-ID: Subject: Re: pg_stat_statements IN problem From: Laurenz Albe To: byme@byme.email, Wim Bertels Cc: "pgsql-general@lists.postgresql.org" Date: Tue, 03 Oct 2023 10:54:17 +0200 In-Reply-To: <9o10Aeez9I_z3V3wCkp9jmm7sbI5JaySNUqBl44FoDvLz7RaPpYTxF6ZifZH7YKkWaWfM3XeFpDDFsHzMfb3koq8S51Z0NjbRJ6TT0_Hu0g=@byme.email> References: <9o10Aeez9I_z3V3wCkp9jmm7sbI5JaySNUqBl44FoDvLz7RaPpYTxF6ZifZH7YKkWaWfM3XeFpDDFsHzMfb3koq8S51Z0NjbRJ6TT0_Hu0g=@byme.email> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2023-10-03 at 08:05 +0000, byme@byme.email wrote: > "This obfuscates our monitoring because the same query with different amo= unt of arguments gets translated into this: > IN ($1, $2) > and so on." >=20 > The questions are: > 1. Shouldnt IN behave so that the query in pg_stat_statements would look = like this: > IN $1 > 2. Shouldnt there be at least some flag to aggregate such queries into on= e? > 3. Is there any workaround how to aggregate those queries except the "=3D= ANY"? > 4. How come no one is bothered by this if this makes pg_stat_statements u= nusable with lots of queries using IN, what others do with this problem? > 5. what do you mean by changing pg_stat_statements with another view/tabl= e? There is currently a patch for this very problem under review: https://commitfest.postgresql.org/44/2837/ The discussion is here: https://www.postgresql.org/message-id/flat/CA+q6zcWtUbT_Sxj0V6HY6EZ89uv5wuG= 5aefpe_9n0Jr3VwntFg@mail.gmail.com You could comment on that patch or review it. Useful reviews and supportin= g comments help move the patch forward. That would best serve your interests= . Yours, Laurenz Albe