Re: pg_stat_statements and "IN" conditions
Dmitry Dolgov <9erthalion6@gmail.com>
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>, Álvaro Herrera <alvherre@alvh.no-ip.org>, Kirill Reshke <reshkekirill@gmail.com>, Sergei Kornilov <sk@zsrv.org>, yasuo.honda@gmail.com, tgl@sss.pgh.pa.us, smithpb2250@gmail.com, vignesh21@gmail.com, michael@paquier.xyz, nathandbossart@gmail.com, stark.cfm@gmail.com, geidav.pg@gmail.com, marcos@f10.com.br, robertmhaas@gmail.com, david@pgmasters.net, pgsql-hackers@postgresql.org, pavel.trukhanov@gmail.com, Sutou Kouhei <kou@clear-code.com>
Date: 2025-02-17T17:16:30Z
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
> On Mon, Feb 17, 2025 at 09:51:32AM GMT, Sami Imseih wrote: > > This should do it. The last patch for today, > > I looked at v27 today and have a few comments. > > 1/ It looks like the CTE test is missing a check for results. This test was to catch a crash that was happening in older version of the patch, so it doesn't have to verify the actual pgss entry. > 2/ Looking at IsMergeableConst, I am not sure why we care about > things like function volatility, implicit cast or funcid > FirstGenbkiObjectId? Function volatility is important to establish how constant is the result, for now we would like to exclude not immutable functions. The implicit cast and builtin check are there to limit squashing and exclude explicit or user-created functions (the second is probably an overkill, but this could be gradually relatex later). Or are you not sure about something different? > 3/ Here, this looks wrong as we could end up traversing an elements list > twice. Once inside IsMergeableConstList and if that call returns false, we end > up traversing through the elements list again in _jumbleNode. IsMergeableConstList and _jumbleNode serve different purposes, so it's probably unwise to try to replace one with another. E.g. IsMergeableConstList will stop at the first non-constant expression, so it's not a full traversal.