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 1pPUMz-0007OA-M1 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Feb 2023 20:15:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pPUMy-0006aA-IC for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Feb 2023 20:15:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPUMx-0006a1-UK for pgsql-hackers@lists.postgresql.org; Tue, 07 Feb 2023 20:15:12 +0000 Received: from forward502c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d502]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPUMl-0006A5-GM for pgsql-hackers@postgresql.org; Tue, 07 Feb 2023 20:15:10 +0000 Received: from sas2-71fa98757567.qloud-c.yandex.net (sas2-71fa98757567.qloud-c.yandex.net [IPv6:2a02:6b8:c08:bd8f:0:640:71fa:9875]) by forward502c.mail.yandex.net (Yandex) with ESMTP id A56CA5F25F; Tue, 7 Feb 2023 23:14:54 +0300 (MSK) Received: from mail.yandex.ru (mail.yandex.ru [94.19.181.84]) by sas2-71fa98757567.qloud-c.yandex.net (mxback/Yandex) with HTTP id oEj04W2V30U1-ojkfK5RZ; Tue, 07 Feb 2023 23:14:53 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zsrv.org; s=mail; t=1675800893; bh=/zLQW2EEVIZKszfubFJ8xpaN+CyQ4G/KfIv3k8MgYJY=; h=Message-Id:References:Date:Cc:Subject:In-Reply-To:To:From; b=geUSTxgfqMQeVqbDBBgLhyaJF0Z4xIn1DteJ7/hGPiJBpZGrRUO0YJmtsYwtKKTAZ rgtkGPcBUgsDPR/r5/RxaDTKNfqotAJNLF7SMs9uEjeuIXzP8+Ud+MzuPsLtbkF+Wq QI163pmNnlkuD43wkIRUsnrPNJYbHESTVXAXEMNw= Authentication-Results: sas2-71fa98757567.qloud-c.yandex.net; dkim=pass header.i=@zsrv.org Received: by znolar4klagewshm.sas.yp-c.yandex.net with HTTP; Tue, 07 Feb 2023 23:14:52 +0300 From: Sergei Kornilov To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Michael Paquier , Alvaro Herrera , Marcos Pegoraro , vignesh C , Robert Haas , Zhihong Yu , David Steele , PostgreSQL-development , Greg Stark , Pavel Trukhanov , Tom Lane In-Reply-To: <20230205195600.e3bhwszzm5kdyyxl@erthalion.local> References: <20230129133219.tpuzqbyqw3ojztbd@erthalion.local> <20230202140727.g7tw7qjo43g54wcb@alvherre.pgsql> <20230202150554.dwxhvw23epcskppb@ddolgov.remote.csb> <20230204170841.xfgxoo7ymwbvu7yx@erthalion.local> <20230205113346.gmbf5ycnukuhnmqa@erthalion.local> <2420105.1675612952@sss.pgh.pa.us> <20230205195600.e3bhwszzm5kdyyxl@erthalion.local> Subject: Re:pg_stat_statements and "IN" conditions MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 07 Feb 2023 23:14:52 +0300 Message-Id: <966631675800892@znolar4klagewshm.sas.yp-c.yandex.net> Content-Transfer-Encoding: 7bit Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello! Unfortunately, rebase is needed again due to recent changes in queryjumblefuncs ( 9ba37b2cb6a174b37fc51d0649ef73e56eae27fc ) It seems a little strange to me that with const_merge_threshold = 1, such a test case gives the same result as with const_merge_threshold = 2 select pg_stat_statements_reset(); set const_merge_threshold to 1; select * from test where i in (1,2,3); select * from test where i in (1,2); select * from test where i in (1); select query, calls from pg_stat_statements order by query; query | calls -------------------------------------+------- select * from test where i in (...) | 2 select * from test where i in ($1) | 1 Probably const_merge_threshold = 1 should produce only "i in (...)"? const_merge_threshold is "the minimal length of an array" (more or equal) or "array .. length is larger than" (not equals)? I think the documentation is ambiguous in this regard. I also noticed a typo in guc_tables.c: "Sets the minimal numer of constants in an array" -> number regards, Sergei