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 1roOy5-001I9O-9b for pgsql-hackers@arkaria.postgresql.org; Sun, 24 Mar 2024 14:37:01 +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 1roOy2-00CxMY-FT for pgsql-hackers@arkaria.postgresql.org; Sun, 24 Mar 2024 14:36:58 +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 1roOy1-00CxMP-SD for pgsql-hackers@lists.postgresql.org; Sun, 24 Mar 2024 14:36:58 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1roOxu-006BXK-2O for pgsql-hackers@postgresql.org; Sun, 24 Mar 2024 14:36:56 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5d4d15ec7c5so2401963a12.1 for ; Sun, 24 Mar 2024 07:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711291010; x=1711895810; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=B8AWDQ2fX7+7koDjvy8ko9i8shLzcER1QzOYcFw27yY=; b=QD62PQSVMHw8kw/Vclgg+bNDwZFNhaR/wQNHEwGdKQ8jSijlzQw+lLwLqw1+pwt+40 9pycA8bx0xc3jJDFkL9OzFbnTlnM/s5DFFlkJW8mSaiKCLZO2LfG29FTua+tb7Vz+qQQ 9MzqpOLvZXjdQ+ncofgeG3MCDJXXRhF5dwZA0HIQ0j0Ls2Aqv3e8HkVN4Vkt5Haz+Bq7 +0QdX30l4l0sOOpiA9T7ggU9Oyt3NWMf7ZFR2tW2/EwNAd7wD7wqiwPZz9MUMo1QwLfa 1nucYsQ9BJS9vlT42t+lmfaUADJQqQIkUEr6VElkBIRcYC92IWtXjS+r8WBtCNw3raS4 DjXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711291010; x=1711895810; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B8AWDQ2fX7+7koDjvy8ko9i8shLzcER1QzOYcFw27yY=; b=a9Zg6OqGFYHdtAiZg2iVQd4npC4U+VwL0GD9TqJx/Of49DgOI1vI1bpWCen/QWGTMI YGuiPc/sBgYgmZkAOJV1kHX7YCRKiQrzVfe37mRXYFdWKxg5V6hQAuS51/lP51PXZA9H GyyGT/nsIVgLBlPwu8tXinOOcce4Gs5hbHYdzoU87hrj1AQZuO80i/5gSCCp8XIGCPG8 8J68SREPZRo8s/cSZVUERJ/NuK/KrwtGtEZ5B7UAdB0Bsm6C7KROtME/5r8x9uh1Yj/y 4/WZFGfI3fZjDK5qOWBEeE9feRY2fYS7UVQwlLt1X0IlSFxuqwaLYPcDXAHqBphl1kMv rstQ== X-Forwarded-Encrypted: i=1; AJvYcCXzVSflG4UG4m8jqgWprsvJVuubkrDYG+E8+RzqRTnQXxqG7uEGDKw+FKL7wzFU6QTJ+btaFiPBEuucnqbo76SbPgKE9QfgC7/A386l X-Gm-Message-State: AOJu0YxxUhLboWUmJ5UCmZ1AJiUahhsbWa8dDUxrjKsMZnC0pxop3RxH v173WVGkp9iovGL0SRb+hyXzGJZ23HRJc4bJVWFvZKz0CA7GTkjxUL8HirxDwrCoXF1rUXLjyJ1 Fn94BA/JN34IBbSniZzlLoXXBfNE= X-Google-Smtp-Source: AGHT+IFqQ2tkukJJ98a/KmHtMjR9kbyis73n9EZ1j+qVQOSbsyPrT9Upts9JGq5Gqo9Jxf01Q0xbj3FKcqQ86CAxKLQ= X-Received: by 2002:a17:90a:6f85:b0:29f:cf88:c2d2 with SMTP id e5-20020a17090a6f8500b0029fcf88c2d2mr3891014pjk.12.1711291010100; Sun, 24 Mar 2024 07:36:50 -0700 (PDT) MIME-Version: 1.0 References: <20231031090307.qkpmcgq53bzcoz7c@erthalion.local> <20240108161020.pltnhlbtc7x32tj4@erthalion.local> <20240113140538.ifmkd7y2kvfnsj3w@erthalion.local> <20240122161123.tzau4pe6wp7h5vh2@erthalion.local> <3746172.1705941322@sss.pgh.pa.us> <20240122170727.6zcjobtvqz7z2cwp@ddolgov.remote.csb> <20240122210036.k55qagkrscfapwqb@erthalion.local> <20240323182026.2jksclhldwvk2hmh@ddolgov.remote.csb> In-Reply-To: <20240323182026.2jksclhldwvk2hmh@ddolgov.remote.csb> From: Yasuo Honda Date: Sun, 24 Mar 2024 23:36:38 +0900 Message-ID: Subject: Re: pg_stat_statements and "IN" conditions To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Tom Lane , Peter Smith , vignesh C , Michael Paquier , Nathan Bossart , "Gregory Stark (as CFM)" , David Geier , Sergei Kornilov , Alvaro Herrera , Marcos Pegoraro , Robert Haas , Zhihong Yu , David Steele , PostgreSQL-development , Pavel Trukhanov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for the information. I can apply these 4 patches from 0eb23285a2 . I tested this branch from Ruby on Rails and it gets some unexpected behavior from my point of view. Setting pg_stat_statements.query_id_const_merge_threshold =3D 5 does not normalize sql queries whose number of in clauses exceeds 5. Here are test steps. https://gist.github.com/yahonda/825ffccc4dcb58aa60e12ce33d25cd45#expected-b= ehavior It would be appreciated if I can get my understanding correct. -- Yasuo Honda On Sun, Mar 24, 2024 at 3:20=E2=80=AFAM Dmitry Dolgov <9erthalion6@gmail.co= m> wrote: > Sure, I can rebase, give me a moment. If you don't want to wait, there > is a base commit in the patch, against which it should be applied > without issues, 0eb23285a2.