From: | Sami Imseih <samimseih(at)gmail(dot)com> |
---|---|
To: | Dmitry Dolgov <9erthalion6(at)gmail(dot)com> |
Cc: | Julien Rouhaud <rjuju123(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Sergei Kornilov <sk(at)zsrv(dot)org>, yasuo(dot)honda(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, smithpb2250(at)gmail(dot)com, vignesh21(at)gmail(dot)com, michael(at)paquier(dot)xyz, nathandbossart(at)gmail(dot)com, stark(dot)cfm(at)gmail(dot)com, geidav(dot)pg(at)gmail(dot)com, marcos(at)f10(dot)com(dot)br, robertmhaas(at)gmail(dot)com, david(at)pgmasters(dot)net, pgsql-hackers(at)postgresql(dot)org, pavel(dot)trukhanov(at)gmail(dot)com, Sutou Kouhei <kou(at)clear-code(dot)com> |
Subject: | Re: pg_stat_statements and "IN" conditions |
Date: | 2025-02-14 16:06:15 |
Message-ID: | CAA5RZ0sUUovmUoxsOvWohEThZPFYoX=uc2wemh_pwr8e1cP9wQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> > > I perhap meant "missing chunk" instead of "trimming". To me it just
> > > looked like a trimmed text, which was wrong. Looks like v25
> > > deals with that better at least. I am just not sure about all that we are doing
> > > here as I believe it may open up big changes for bugs generating the normalized
> > > query texts. I'm a bit worried about that. IMO, we are better off just
> > > adding a comment
> > > at the start of a query that this query text such as "/*
> > > query_id_squash_values */"
> > > and keeping all the parameter symbols in-place.
> >
> > I see what you mean, but keeping everything in place is partially
> > defeating purpose of the patch. The idea is not only to make those
> > queries to have the same query_id, but also to reduce the size of
> > queries themselves. E.g. the use case scenario that has triggered the
> > patch was about queries having dozens of thousands of such constants,
> > so that the size of them was a burden on its own.
>
> My experience with this issue is not so much the size of the query text,
> but it's the fact that similar queries ( with varying length IN-lists ) being
> tracked in different entries, causing high deallocation and heavy
> garbage collection. This is besides the overall loss of quality of
> the data from pg_stat_statements if there is constant deallocation.
>
> But, with what you are doing with this patch, we will now have
> a single tracking entry for similar queries with varying IN-lists and
> even if the query text is *large*, it's only a single entry tracking
> and we are no longer continuously deallocating and garbage
> collecting as frequently.
Another point, I think if we want to control the size of the query texts,
that could be something that is maybe useful overall for pg_stat_statements,
not just for IN-list type queries.
--
Sami
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Sabino Mullane | 2025-02-14 16:39:41 | Re: [Feature Request] INSERT FROZEN to Optimize Large Cold Data Imports and Migrations |
Previous Message | Sami Imseih | 2025-02-14 16:02:39 | Re: pg_stat_statements and "IN" conditions |