Re: pg_stat_statements and "IN" conditions
Yasuo Honda <yasuo.honda@gmail.com>
From: Yasuo Honda <yasuo.honda@gmail.com>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Peter Smith <smithpb2250@gmail.com>, vignesh C <vignesh21@gmail.com>, Michael Paquier <michael@paquier.xyz>, Nathan Bossart <nathandbossart@gmail.com>,
"Gregory Stark (as CFM)" <stark.cfm@gmail.com>, David Geier <geidav.pg@gmail.com>, Sergei Kornilov <sk@zsrv.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>,
Marcos Pegoraro <marcos@f10.com.br>, Robert Haas <robertmhaas@gmail.com>, David Steele <david@pgmasters.net>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Pavel Trukhanov <pavel.trukhanov@gmail.com>
Date: 2024-03-26T07:21:46Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Introduce squashing of constant lists in query jumbling
- 62d712ecfd94 18.0 landed
-
Make documentation builds reproducible
- b0f0a9432d0b 17.0 cited
-
Include values of A_Const nodes in query jumbling
- 9ba37b2cb6a1 16.0 cited
-
Teach planner about more monotonic window functions
- 456fa635a909 16.0 cited
-
Split up guc.c for better build speed and ease of maintenance.
- 0a20ff54f5e6 16.0 cited
Yes. The script uses prepared statements because Ruby on Rails enables prepared statements by default for PostgreSQL databases. Then I tested this branch https://github.com/yahonda/postgres/tree/pg_stat_statements without using prepared statements as follows and all of them do not normalize in clause values. - Disabled prepared statements by setting `prepared_statements: false` https://gist.github.com/yahonda/2c2d6ac7a955886a305750eecfd07c5e - Use ruby-pg https://gist.github.com/yahonda/2f0efb11ae888d8f6b27a07e0b833fdf - Use psql https://gist.github.com/yahonda/c830379b33d66a743aef159aa03d7e49 I do not know why even if I use psql, the query column at pg_stat_sql_statement shows it is like a prepared statement "IN ($1, $2)". On Tue, Mar 26, 2024 at 1:35 AM Dmitry Dolgov <9erthalion6@gmail.com> wrote: > From what I understand out of the description this ruby script uses > prepared statements, passing values as parameters, right? Unfortunately > the current version of the patch doesn't handle that, it works with > constants only [1]. The original incarnation of this feature was able to > handle that, but the implementation was considered to be not suitable -- > thus, to make some progress, it was left outside.