From: Nathan Bossart <nathandbossart@gmail.com>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Gregory Stark (as CFM) <stark.cfm@gmail.com>
Cc: David Geier <geidav.pg@gmail.com>
Cc: Sergei Kornilov <sk@zsrv.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Marcos Pegoraro <marcos@f10.com.br>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: David Steele <david@pgmasters.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Pavel Trukhanov <pavel.trukhanov@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: pg_stat_statements and "IN" conditions
Date: Mon, 3 Jul 2023 21:46:11 -0700
Message-ID: <20230704044611.GA3373000@nathanxps13> (raw)
In-Reply-To: <20230319122734.xkba536kut3g4gcy@erthalion.local>
References: <dda65b89-4ebf-261c-de9c-7b91ab9e4047@gmail.com>
<20230211104707.grsicemegr7d3mgh@erthalion.local>
<20230211120820.y7krq37jubnjsa5b@erthalion.local>
<07919318-6c35-a13f-6a1d-98686a3e38de@gmail.com>
<20230217154602.uf3a3cgqeoeysycz@erthalion.local>
<8702fa3e-5aac-dcf0-161b-faa2b9eadad6@gmail.com>
<20230226104619.jfmwrpd5zrkmp3eu@erthalion.local>
<CAM-w4HO29FpoX5oYR7tuxP9sZA1s3zLV94c_79h_uQeNHUjhyQ@mail.gmail.com>
<20230314190432.l4oe3wa3pvt5b7hx@erthalion.local>
<20230319122734.xkba536kut3g4gcy@erthalion.local>
On Sun, Mar 19, 2023 at 01:27:34PM +0100, Dmitry Dolgov wrote:
> + If this parameter is on, two queries with an array will get the same
> + query identifier if the only difference between them is the number of
> + constants, both numbers is of the same order of magnitude and greater or
> + equal 10 (so the order of magnitude is greather than 1, it is not worth
> + the efforts otherwise).
IMHO this adds way too much complexity to something that most users would
expect to be an on/off switch. If I understand Álvaro's suggestion [0]
correctly, he's saying that in addition to allowing "on" and "off", it
might be worth allowing something like "powers" to yield roughly the
behavior described above. I don't think he's suggesting that this "powers"
behavior should be the only available option. Also, it seems
counterintuitive that queries with fewer than 10 constants are not merged.
In the interest of moving this patch forward, I would suggest making it a
simple on/off switch in 0002 and moving the "powers" functionality to a new
0003 patch. I think separating out the core part of this feature might
help reviewers. As you can see, I got distracted by the complicated
threshold logic and ended up focusing my first round of review there.
[0] https://postgr.es/m/20230209172651.cfgrebpyyr72h7fv%40alvherre.pgsql
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, 9erthalion6@gmail.com, stark.cfm@gmail.com, geidav.pg@gmail.com, sk@zsrv.org, michael@paquier.xyz, alvherre@alvh.no-ip.org, marcos@f10.com.br, vignesh21@gmail.com, robertmhaas@gmail.com, zyu@yugabyte.com, david@pgmasters.net, pavel.trukhanov@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: pg_stat_statements and "IN" conditions
In-Reply-To: <20230704044611.GA3373000@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox