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 1pXd7A-0007ei-4H for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 07:12:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXd78-0001jJ-Ss for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 07:12:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXd78-0001jA-JN for pgsql-hackers@lists.postgresql.org; Thu, 02 Mar 2023 07:12:30 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pXd76-0003Bo-2B for pgsql-hackers@lists.postgresql.org; Thu, 02 Mar 2023 07:12:30 +0000 Received: by mail-wr1-x42c.google.com with SMTP id e13so3998246wro.10 for ; Wed, 01 Mar 2023 23:12:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+yqEqsGdh+KwQFbbL7CtQDJzE4wm2Le8wPlqjFsdH/s=; b=KxIeoklz6dASIiHRPv/dDGGOe/+GenaZEiFU61zgI/NmXoU2NmBHh1ZQDOlsoS3joI SHTq4UNSlzK8EvJdA7h15GugO05Yq1Ypvp2qz0HVHOXiXeWixRmnDtGw2jV7cp9SPKVQ 3ysO/N6tq7iNGiNOb9J6Gnyg/Q85baSGL2yUOlKOlhJ/O3NtMD2epD2AeT+TQyqYB8Fu APqk7D9ouD6OeCfYGvY7BZMMQS+XGWS2T30LiuLp9bRujRdYtwrl2Jb+jIFPxkesfjhJ HoIgTOldPn4i7bV5hOn8sSMGSphBAMUEc2NPaPydHidGzAMVKomQQpYApjOUiRn9RNP/ 9YXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+yqEqsGdh+KwQFbbL7CtQDJzE4wm2Le8wPlqjFsdH/s=; b=sGoGXOI3WAMphocyc5AekEGw81kCeQqOLrVGBGt2m8PnXdz8I6wTz/5yMSOek0ficg 3bC5IbfOUK+LYZ+5zYOK8Zscef0wQO//F+wDa3Y1jty/kq0FWEELQ5McbSDAGwyNpbG2 Z16gWVNoRDbHRY0MpcAieR1nmuiJ/164Jha/+2u8dKSa9+hhtT/qqiC3U7yZ2Gdcxipp ixvdndyhY1Z1gIWM01ZPKGPX55/g7CrwNUiFJJTH3Ep67aDP6VliQpNishg8KMiMU7z7 bxjnN4IYPugrjUXfsIGPaW8S31G9Xhi7rtbx3hQooQeoK3n1BIQQ1x42Kgvdm+rEw8gD h17A== X-Gm-Message-State: AO0yUKW01sPPRqhlF/bl2DZ6cbnP7QgBkazU1/yNRihZ4SmKkfFZvtE2 iR87iQbSR6mxhWuKHL33+Jw= X-Google-Smtp-Source: AK7set+s3r1iMnC+f1wq+YEcWsYhawLxbqAUbrALxfZ3YFMFUDZ1NhkA4rD6x5/Qs4ygzz1siMxusg== X-Received: by 2002:adf:ee48:0:b0:2c9:b9bf:e21a with SMTP id w8-20020adfee48000000b002c9b9bfe21amr721279wro.2.1677741146205; Wed, 01 Mar 2023 23:12:26 -0800 (PST) Received: from [192.168.4.38] ([54.239.6.184]) by smtp.gmail.com with ESMTPSA id o2-20020a05600c510200b003e208cec49bsm5500038wms.3.2023.03.01.23.12.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Mar 2023 23:12:25 -0800 (PST) Message-ID: <1f84685f-1ffd-4937-de63-aaa1513a0b7e@gmail.com> Date: Thu, 2 Mar 2023 08:12:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Normalization of utility queries in pg_stat_statements To: Michael Paquier Cc: Postgres hackers References: <0e067034-e92c-302b-24ed-492bca228e26@gmail.com> <14965f63-6d78-45ff-d029-daafe8eddb40@gmail.com> Content-Language: en-US From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 3/1/23 5:47 AM, Michael Paquier wrote: > On Mon, Feb 20, 2023 at 11:34:59AM +0900, Michael Paquier wrote: >> With the patches.. > > Attached is an updated patch set, where I have done more refactoring > work for the regression tests of pg_stat_statements, splitting > pg_stat_statments.sql into the following files: > - user_activity.sql for the role-level resets. > - wal.sql for the WAL generation tracking. > - dml.sql for insert/update/delete/merge and row counts. > - The main file is renamed to select.sql, as it now only covers SELECT > patterns. > Thanks! Splitting even more and removing pg_stat_statements.sql/out does make sense to me, so +1 for the patch. Applying 0001 produces: Applying: Split more regression tests of pg_stat_statements .git/rebase-apply/patch:1735: new blank line at EOF. + .git/rebase-apply/patch:2264: new blank line at EOF. + warning: 2 lines add whitespace errors. Nits: +++ b/contrib/pg_stat_statements/sql/wal.sql @@ -0,0 +1,22 @@ +-- +-- Validate WAL generation metrics +-- + +SET pg_stat_statements.track_utility = FALSE; + +-- utility "create table" should not be shown This comment is coming from the previous pg_stat_statements.sql but I wonder if it makes sense here as testing utility is not the initial purpose of wal.sql. Same comment for dml.sql: +-- utility "create table" should not be shown +CREATE TEMP TABLE pgss_dml_tab (a int, b char(20)); What about removing those comments? > There is no change in the code coverage or the patterns tested. I had a look (comparing the new .sql files with the old pg_stat_statements.sql content) and I agree. Except from the Nits above, 0001 LGTM. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com