Re: pg_stat_statements and "IN" conditions

2024-05-12 Thread Dmitry Dolgov
> On Tue, Apr 23, 2024 at 10:18:15AM +0200, Dmitry Dolgov wrote: > > On Mon, Apr 15, 2024 at 06:09:29PM +0900, Sutou Kouhei wrote: > > > > Thanks. I'm not familiar with this code base but I've > > reviewed these patches because I'm interested in this > > feature too. > > Thanks for the review! The

Re: pg_stat_statements and "IN" conditions

2024-04-23 Thread Dmitry Dolgov
> On Mon, Apr 15, 2024 at 06:09:29PM +0900, Sutou Kouhei wrote: > > Thanks. I'm not familiar with this code base but I've > reviewed these patches because I'm interested in this > feature too. Thanks for the review! The commentaries for the first patch make sense to me, will apply. > 0003: > > >

Re: pg_stat_statements and "IN" conditions

2024-04-15 Thread Sutou Kouhei
Hi, In <20240404143514.a26f7ttxrbdfc73a@erthalion.local> "Re: pg_stat_statements and "IN" conditions" on Thu, 4 Apr 2024 16:35:14 +0200, Dmitry Dolgov <9erthali...@gmail.com> wrote: > Here is the rebased version. Thanks. I'm not familiar with this code b

Re: pg_stat_statements and "IN" conditions

2024-04-04 Thread Dmitry Dolgov
> On Wed, Mar 27, 2024 at 08:56:12AM +0900, Yasuo Honda wrote: > Thanks for the useful info. > > Ruby on Rails uses bigint as a default data type for the primary key > and prepared statements have been enabled by default for PostgreSQL. > I'm looking forward to these current patches being merged

Re: pg_stat_statements and "IN" conditions

2024-03-26 Thread Yasuo Honda
Thanks for the useful info. Ruby on Rails uses bigint as a default data type for the primary key and prepared statements have been enabled by default for PostgreSQL. I'm looking forward to these current patches being merged as a first step and future versions of pg_stat_statements will support

Re: pg_stat_statements and "IN" conditions

2024-03-26 Thread Dmitry Dolgov
> On Tue, Mar 26, 2024 at 04:21:46PM +0900, Yasuo Honda wrote: > 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 >

Re: pg_stat_statements and "IN" conditions

2024-03-26 Thread Yasuo Honda
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

Re: pg_stat_statements and "IN" conditions

2024-03-25 Thread Dmitry Dolgov
> On Sun, Mar 24, 2024 at 11:36:38PM +0900, Yasuo Honda wrote: > Thanks for the information. I can apply these 4 patches from > 0eb23285a2 . I tested this branch from Ruby on Rails and it gets some > unexpected behavior from my point of view. > Setting

Re: pg_stat_statements and "IN" conditions

2024-03-24 Thread Yasuo Honda
Thanks for the information. I can apply these 4 patches from 0eb23285a2 . I tested this branch from Ruby on Rails and it gets some unexpected behavior from my point of view. Setting pg_stat_statements.query_id_const_merge_threshold = 5 does not normalize sql queries whose number of in clauses

Re: pg_stat_statements and "IN" conditions

2024-03-23 Thread Dmitry Dolgov
> On Sat, Mar 23, 2024 at 04:13:44PM +0900, Yasuo Honda wrote: > Hi, I'm interested in this feature. It looks like these patches have > some conflicts. > > http://cfbot.cputube.org/patch_47_2837.log > > Would you rebase these patches? Sure, I can rebase, give me a moment. If you don't want to

Re: pg_stat_statements and "IN" conditions

2024-03-23 Thread Yasuo Honda
Hi, I'm interested in this feature. It looks like these patches have some conflicts. http://cfbot.cputube.org/patch_47_2837.log Would you rebase these patches? Thanks, -- Yasuo Honda On Sat, Mar 23, 2024 at 4:11 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > Oh, I see, thanks. Give me a

Re: pg_stat_statements and "IN" conditions

2024-01-22 Thread Dmitry Dolgov
> On Mon, Jan 22, 2024 at 06:07:27PM +0100, Dmitry Dolgov wrote: > > Please notice that at the moment, it's not being tested at all because > > of a patch-apply failure -- that's what the little triangular symbol > > means. The rest of the display concerns the test results from the > > last

Re: pg_stat_statements and "IN" conditions

2024-01-22 Thread Dmitry Dolgov
> On Mon, Jan 22, 2024 at 11:35:22AM -0500, Tom Lane wrote: > Dmitry Dolgov <9erthali...@gmail.com> writes: > >> On Mon, Jan 22, 2024 at 05:33:26PM +1100, Peter Smith wrote: > >> Hi, This patch has a CF status of "Needs Review" [1], but it seems > >> there was a CFbot test failure last time it was

Re: pg_stat_statements and "IN" conditions

2024-01-22 Thread Tom Lane
Dmitry Dolgov <9erthali...@gmail.com> writes: >> On Mon, Jan 22, 2024 at 05:33:26PM +1100, Peter Smith wrote: >> Hi, This patch has a CF status of "Needs Review" [1], but it seems >> there was a CFbot test failure last time it was run [2]. Please have a >> look and post an updated version if

Re: pg_stat_statements and "IN" conditions

2024-01-22 Thread Dmitry Dolgov
> On Mon, Jan 22, 2024 at 05:33:26PM +1100, Peter Smith wrote: > 2024-01 Commitfest. > > Hi, This patch has a CF status of "Needs Review" [1], but it seems > there was a CFbot test failure last time it was run [2]. Please have a > look and post an updated version if necessary. > > == > [1]

Re: pg_stat_statements and "IN" conditions

2024-01-21 Thread Peter Smith
2024-01 Commitfest. Hi, This patch has a CF status of "Needs Review" [1], but it seems there was a CFbot test failure last time it was run [2]. Please have a look and post an updated version if necessary. == [1] https://commitfest.postgresql.org/46/2837/ [2]

Re: pg_stat_statements and "IN" conditions

2024-01-13 Thread Dmitry Dolgov
> On Mon, Jan 08, 2024 at 05:10:20PM +0100, Dmitry Dolgov wrote: > > On Sat, Jan 06, 2024 at 09:04:54PM +0530, vignesh C wrote: > > > > CFBot shows documentation build has failed at [1] with: > > [07:44:55.531] time make -s -j${BUILD_JOBS} -C doc > > [07:44:57.987] postgres.sgml:572: element xref:

Re: pg_stat_statements and "IN" conditions

2024-01-08 Thread Dmitry Dolgov
> On Sat, Jan 06, 2024 at 09:04:54PM +0530, vignesh C wrote: > > CFBot shows documentation build has failed at [1] with: > [07:44:55.531] time make -s -j${BUILD_JOBS} -C doc > [07:44:57.987] postgres.sgml:572: element xref: validity error : IDREF > attribute linkend references an unknown ID >

Re: pg_stat_statements and "IN" conditions

2024-01-06 Thread vignesh C
On Tue, 31 Oct 2023 at 14:36, Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Fri, Oct 27, 2023 at 05:02:44PM +0200, Dmitry Dolgov wrote: > > > On Thu, Oct 26, 2023 at 09:08:42AM +0900, Michael Paquier wrote: > > > typedef struct ArrayExpr > > > { > > > +

Re: pg_stat_statements and "IN" conditions

2023-10-31 Thread Dmitry Dolgov
> On Fri, Oct 27, 2023 at 05:02:44PM +0200, Dmitry Dolgov wrote: > > On Thu, Oct 26, 2023 at 09:08:42AM +0900, Michael Paquier wrote: > > typedef struct ArrayExpr > > { > > + pg_node_attr(custom_query_jumble) > > + > > > > Hmm. I am not sure that this is the best approach > >

Re: pg_stat_statements and "IN" conditions

2023-10-27 Thread Dmitry Dolgov
> On Thu, Oct 26, 2023 at 09:08:42AM +0900, Michael Paquier wrote: > typedef struct ArrayExpr > { > + pg_node_attr(custom_query_jumble) > + > > Hmm. I am not sure that this is the best approach > implementation-wise. Wouldn't it be better to invent a new > pg_node_attr (these can include

Re: pg_stat_statements and "IN" conditions

2023-10-25 Thread Michael Paquier
On Tue, Oct 17, 2023 at 10:15:41AM +0200, Dmitry Dolgov wrote: > In the current patch version I didn't add anything yet to address the > question of having more parameters to tune constants merging. The main > obstacle as I see it is that the information for that has to be > collected when

Re: pg_stat_statements and "IN" conditions

2023-10-17 Thread Dmitry Dolgov
> On Fri, Oct 13, 2023 at 03:35:19PM +0200, Dmitry Dolgov wrote: > > On Fri, Oct 13, 2023 at 05:07:00PM +0900, Michael Paquier wrote: > > Now, it doesn't mean that this approach with the "powers" will never > > happen, but based on the set of opinions I am gathering on this thread > > I would

Re: pg_stat_statements and "IN" conditions

2023-10-13 Thread Nathan Bossart
On Tue, Jul 04, 2023 at 09:02:56PM +0200, Dmitry Dolgov wrote: >> On Mon, Jul 03, 2023 at 09:46:11PM -0700, Nathan Bossart wrote: >> Also, it seems counterintuitive that queries with fewer than 10 >> constants are not merged. > > Why? What would be your intuition using this feature? For the

Re: pg_stat_statements and "IN" conditions

2023-10-13 Thread Dmitry Dolgov
> On Fri, Oct 13, 2023 at 05:07:00PM +0900, Michael Paquier wrote: > Now, it doesn't mean that this approach with the "powers" will never > happen, but based on the set of opinions I am gathering on this thread > I would suggest to rework the patch as follows: > - First implement an on/off switch

Re: pg_stat_statements and "IN" conditions

2023-10-13 Thread Michael Paquier
On Tue, Jul 04, 2023 at 09:02:56PM +0200, Dmitry Dolgov wrote: > On Mon, Jul 03, 2023 at 09:46:11PM -0700, Nathan Bossart wrote: >> IMHO this adds way too much complexity to something that most users would >> expect to be an on/off switch. > > This documentation is exclusively to be precise about

Re: pg_stat_statements and "IN" conditions

2023-10-08 Thread Yasuo Honda
Hi, this is my first email to the pgsql hackers. I came across this email thread while looking at https://github.com/rails/rails/pull/49388 for Ruby on Rails one of the popular web application framework by replacing every query `in` clause with `any` to reduce similar entries in

Re: pg_stat_statements and "IN" conditions

2023-10-03 Thread Maciek Sakrejda
I've also tried the patch and I see the same results as Jakub, which make sense to me. I did have issues getting it to apply, though: `git am` complains about a conflict, though patch itself was able to apply it.

Re: pg_stat_statements and "IN" conditions

2023-09-21 Thread Jakub Wartak
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:tested, passed I've tested the patched on 17devel/master and it is my feeling -

Re: pg_stat_statements and "IN" conditions

2023-07-04 Thread Dmitry Dolgov
> On Mon, Jul 03, 2023 at 09:46:11PM -0700, Nathan Bossart wrote: Thanks for reviewing. > 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

Re: pg_stat_statements and "IN" conditions

2023-07-03 Thread Nathan Bossart
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

Re: pg_stat_statements and "IN" conditions

2023-03-19 Thread Dmitry Dolgov
> On Tue, Mar 14, 2023 at 08:04:32PM +0100, Dmitry Dolgov wrote: > > On Tue, Mar 14, 2023 at 02:14:17PM -0400, Gregory Stark (as CFM) wrote: > > So I was seeing that this patch needs a rebase according to cfbot. > > Yeah, folks are getting up to speed in with pgss improvements recently. > Thanks

Re: pg_stat_statements and "IN" conditions

2023-03-14 Thread Dmitry Dolgov
> On Tue, Mar 14, 2023 at 02:14:17PM -0400, Gregory Stark (as CFM) wrote: > So I was seeing that this patch needs a rebase according to cfbot. Yeah, folks are getting up to speed in with pgss improvements recently. Thanks for letting me know. > However it looks like the review feedback you're

Re: pg_stat_statements and "IN" conditions

2023-03-14 Thread Gregory Stark (as CFM)
So I was seeing that this patch needs a rebase according to cfbot. However it looks like the review feedback you're looking for is more of design questions. What jumbling is best to include in the feature set and which is best to add in later patches. It sounds like you've gotten conflicting

Re: pg_stat_statements and "IN" conditions

2023-02-26 Thread Dmitry Dolgov
> On Thu, Feb 23, 2023 at 09:48:35AM +0100, David Geier wrote: > Hi, > > > > Seems like supporting only constants is a good starting > > > point. The only thing that is likely confusing for users is that NUMERICs > > > (and potentially constants of other types) are unsupported. Wouldn't it be > >

Re: pg_stat_statements and "IN" conditions

2023-02-23 Thread David Geier
Hi, Seems like supporting only constants is a good starting point. The only thing that is likely confusing for users is that NUMERICs (and potentially constants of other types) are unsupported. Wouldn't it be fairly simple to support them via something like the following?    

Re: pg_stat_statements and "IN" conditions

2023-02-17 Thread Dmitry Dolgov
> On Thu, Feb 09, 2023 at 08:43:29PM +0100, Dmitry Dolgov wrote: > > On Thu, Feb 09, 2023 at 06:26:51PM +0100, Alvaro Herrera wrote: > > On 2023-Feb-09, Dmitry Dolgov wrote: > > > > > > On Thu, Feb 09, 2023 at 02:30:34PM +0100, Peter Eisentraut wrote: > > > > > > What is the point of making this a

Re: pg_stat_statements and "IN" conditions

2023-02-17 Thread Dmitry Dolgov
> On Wed, Feb 15, 2023 at 08:51:56AM +0100, David Geier wrote: > Hi, > > On 2/11/23 13:08, Dmitry Dolgov wrote: > > > On Sat, Feb 11, 2023 at 11:47:07AM +0100, Dmitry Dolgov wrote: > > > > > > The original version of the patch was doing all of this, i.e. handling > > > numerics, Param nodes,

Re: pg_stat_statements and "IN" conditions

2023-02-14 Thread David Geier
Hi, On 2/11/23 13:08, Dmitry Dolgov wrote: On Sat, Feb 11, 2023 at 11:47:07AM +0100, Dmitry Dolgov wrote: The original version of the patch was doing all of this, i.e. handling numerics, Param nodes, RTE_VALUES. The commentary about find_const_walker in tests is referring to a part of that,

Re: pg_stat_statements and "IN" conditions

2023-02-11 Thread Dmitry Dolgov
> On Sat, Feb 11, 2023 at 11:47:07AM +0100, Dmitry Dolgov wrote: > > The original version of the patch was doing all of this, i.e. handling > numerics, Param nodes, RTE_VALUES. The commentary about > find_const_walker in tests is referring to a part of that, that was > dealing with evaluation of

Re: pg_stat_statements and "IN" conditions

2023-02-11 Thread Dmitry Dolgov
> On Sat, Feb 11, 2023 at 11:03:36AM +0100, David Geier wrote: > Hi, > > On 2/9/23 16:02, Dmitry Dolgov wrote: > > > Unfortunately, rebase is needed again due to recent changes in > > > queryjumblefuncs ( 9ba37b2cb6a174b37fc51d0649ef73e56eae27fc ) > I reviewed the last patch applied to some

Re: pg_stat_statements and "IN" conditions

2023-02-11 Thread David Geier
Hi, On 2/9/23 16:02, Dmitry Dolgov wrote: Unfortunately, rebase is needed again due to recent changes in queryjumblefuncs ( 9ba37b2cb6a174b37fc51d0649ef73e56eae27fc ) I reviewed the last patch applied to some commit from Feb. 4th. It seems a little strange to me that with

Re: pg_stat_statements and "IN" conditions

2023-02-09 Thread Dmitry Dolgov
> On Thu, Feb 09, 2023 at 06:26:51PM +0100, Alvaro Herrera wrote: > On 2023-Feb-09, Dmitry Dolgov wrote: > > > > On Thu, Feb 09, 2023 at 02:30:34PM +0100, Peter Eisentraut wrote: > > > > What is the point of making this a numeric setting? Either you want > > > to merge all values or you don't

Re: pg_stat_statements and "IN" conditions

2023-02-09 Thread Alvaro Herrera
On 2023-Feb-09, Dmitry Dolgov wrote: > > On Thu, Feb 09, 2023 at 02:30:34PM +0100, Peter Eisentraut wrote: > > What is the point of making this a numeric setting? Either you want > > to merge all values or you don't want to merge any values. > > At least in theory the definition of "too many

Re: pg_stat_statements and "IN" conditions

2023-02-09 Thread Dmitry Dolgov
> On Thu, Feb 09, 2023 at 02:30:34PM +0100, Peter Eisentraut wrote: > On 07.02.23 21:14, Sergei Kornilov wrote: > > 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 > > What is the point of making

Re: pg_stat_statements and "IN" conditions

2023-02-09 Thread Dmitry Dolgov
> On Tue, Feb 07, 2023 at 11:14:52PM +0300, Sergei Kornilov wrote: > Hello! Thanks for reviewing. > Unfortunately, rebase is needed again due to recent changes in > queryjumblefuncs ( 9ba37b2cb6a174b37fc51d0649ef73e56eae27fc ) Yep, my favourite game, rebaseball. Will post a new version soon,

Re: pg_stat_statements and "IN" conditions

2023-02-09 Thread Peter Eisentraut
On 07.02.23 21:14, Sergei Kornilov wrote: 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 What is the point of making this a numeric setting? Either you want to merge all values or you don't want

Re: pg_stat_statements and "IN" conditions

2023-02-05 Thread Dmitry Dolgov
> On Sun, Feb 05, 2023 at 11:02:32AM -0500, Tom Lane wrote: > Dmitry Dolgov <9erthali...@gmail.com> writes: > > I'm thinking about this in the following way: the core jumbling logic is > > responsible for deriving locations based on the input expressions; in > > the case of merging we produce less

Re: pg_stat_statements and "IN" conditions

2023-02-05 Thread Tom Lane
Dmitry Dolgov <9erthali...@gmail.com> writes: > I'm thinking about this in the following way: the core jumbling logic is > responsible for deriving locations based on the input expressions; in > the case of merging we produce less locations; pgss have to represent > the result only using locations

Re: pg_stat_statements and "IN" conditions

2023-02-05 Thread Dmitry Dolgov
> On Sun, Feb 05, 2023 at 10:30:25AM +0900, Michael Paquier wrote: > On Sat, Feb 04, 2023 at 06:08:41PM +0100, Dmitry Dolgov wrote: > > Here is the rebased version. To adapt to the latest changes, I've marked > > ArrayExpr with custom_query_jumble to implement this functionality, but > > tried to

Re: pg_stat_statements and "IN" conditions

2023-02-04 Thread Michael Paquier
On Sat, Feb 04, 2023 at 06:08:41PM +0100, Dmitry Dolgov wrote: > Here is the rebased version. To adapt to the latest changes, I've marked > ArrayExpr with custom_query_jumble to implement this functionality, but > tried to make the actual merge logic relatively independent. Otherwise, > everything

Re: pg_stat_statements and "IN" conditions

2023-02-04 Thread Dmitry Dolgov
> On Thu, Feb 02, 2023 at 04:05:54PM +0100, Dmitry Dolgov wrote: > > On Thu, Feb 02, 2023 at 03:07:27PM +0100, Alvaro Herrera wrote: > > This appears to have massive conflicts. Would you please rebase? > > Sure, I was already mentally preparing myself to do so in the view of > recent changes in

Re: pg_stat_statements and "IN" conditions

2023-02-02 Thread Dmitry Dolgov
> On Thu, Feb 02, 2023 at 03:07:27PM +0100, Alvaro Herrera wrote: > This appears to have massive conflicts. Would you please rebase? Sure, I was already mentally preparing myself to do so in the view of recent changes in query jumbling. Will post soon.

Re: pg_stat_statements and "IN" conditions

2023-02-02 Thread Alvaro Herrera
This appears to have massive conflicts. Would you please rebase? -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "¿Cómo puedes confiar en algo que pagas y que no ves, y no confiar en algo que te dan y te lo muestran?" (Germán Poo)

Re: pg_stat_statements and "IN" conditions

2023-01-29 Thread Dmitry Dolgov
> On Sun, Jan 29, 2023 at 09:56:02AM -0300, Marcos Pegoraro wrote: > Em dom., 29 de jan. de 2023 às 09:24, Dmitry Dolgov <9erthali...@gmail.com> > escreveu: > > > > On Fri, Jan 27, 2023 at 08:15:29PM +0530, vignesh C wrote: > > > The patch does not apply on top of HEAD as in [1], please post a

Re: pg_stat_statements and "IN" conditions

2023-01-29 Thread Marcos Pegoraro
Em dom., 29 de jan. de 2023 às 09:24, Dmitry Dolgov <9erthali...@gmail.com> escreveu: > > On Fri, Jan 27, 2023 at 08:15:29PM +0530, vignesh C wrote: > > The patch does not apply on top of HEAD as in [1], please post a rebased > patch: > > Thanks. I think this one should do the trick. > There is

Re: pg_stat_statements and "IN" conditions

2023-01-29 Thread Dmitry Dolgov
> On Fri, Jan 27, 2023 at 08:15:29PM +0530, vignesh C wrote: > The patch does not apply on top of HEAD as in [1], please post a rebased > patch: Thanks. I think this one should do the trick. >From 3c51561ddaecdbc82842fae4fab74cc33526f17c Mon Sep 17 00:00:00 2001 From: Dmitrii Dolgov

Re: pg_stat_statements and "IN" conditions

2023-01-27 Thread vignesh C
On Sun, 25 Sept 2022 at 05:29, Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Sat, Sep 24, 2022 at 04:07:14PM +0200, Dmitry Dolgov wrote: > > > On Fri, Sep 16, 2022 at 09:25:13PM +0300, Sergei Kornilov wrote: > > > Hello! > > > > > > Unfortunately the patch needs another rebase due to the

Re: pg_stat_statements and "IN" conditions

2022-09-24 Thread Dmitry Dolgov
> On Sat, Sep 24, 2022 at 04:07:14PM +0200, Dmitry Dolgov wrote: > > On Fri, Sep 16, 2022 at 09:25:13PM +0300, Sergei Kornilov wrote: > > Hello! > > > > Unfortunately the patch needs another rebase due to the recent split of > > guc.c (0a20ff54f5e66158930d5328f89f087d4e9ab400) > > > > I'm

Re: pg_stat_statements and "IN" conditions

2022-09-24 Thread Dmitry Dolgov
> On Fri, Sep 16, 2022 at 09:25:13PM +0300, Sergei Kornilov wrote: > Hello! > > Unfortunately the patch needs another rebase due to the recent split of guc.c > (0a20ff54f5e66158930d5328f89f087d4e9ab400) > > I'm reviewing a patch on top of a previous commit and noticed a failed test: > > #

Re: pg_stat_statements and "IN" conditions

2022-07-24 Thread Dmitry Dolgov
> On Sat, Mar 26, 2022 at 06:40:35PM +0100, Dmitry Dolgov wrote: > > On Mon, Mar 14, 2022 at 04:51:50PM +0100, Dmitry Dolgov wrote: > > > On Mon, Mar 14, 2022 at 11:38:23AM -0400, Tom Lane wrote: > > > Dmitry Dolgov <9erthali...@gmail.com> writes: > > > > On Mon, Mar 14, 2022 at 11:23:17AM -0400,

Re: pg_stat_statements and "IN" conditions

2022-03-26 Thread Dmitry Dolgov
> On Mon, Mar 14, 2022 at 04:51:50PM +0100, Dmitry Dolgov wrote: > > On Mon, Mar 14, 2022 at 11:38:23AM -0400, Tom Lane wrote: > > Dmitry Dolgov <9erthali...@gmail.com> writes: > > > On Mon, Mar 14, 2022 at 11:23:17AM -0400, Tom Lane wrote: > > >> I do find it odd that the proposed patch doesn't

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Dmitry Dolgov
> On Mon, Mar 14, 2022 at 11:38:23AM -0400, Tom Lane wrote: > Dmitry Dolgov <9erthali...@gmail.com> writes: > > On Mon, Mar 14, 2022 at 11:23:17AM -0400, Tom Lane wrote: > >> I do find it odd that the proposed patch doesn't cause the *entire* > >> list to be skipped over. That seems like extra

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Tom Lane
Dmitry Dolgov <9erthali...@gmail.com> writes: > On Mon, Mar 14, 2022 at 11:23:17AM -0400, Tom Lane wrote: >> I do find it odd that the proposed patch doesn't cause the *entire* >> list to be skipped over. That seems like extra complexity and confusion >> to no benefit. > That's a bit surprising

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Dmitry Dolgov
> On Mon, Mar 14, 2022 at 11:23:17AM -0400, Tom Lane wrote: > Robert Haas writes: > > I do find it odd that the proposed patch doesn't cause the *entire* > list to be skipped over. That seems like extra complexity and confusion > to no benefit. That's a bit surprising for me, I haven't even

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 14, 2022 at 10:57 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: >> I'm not sure if I follow the last point. WHERE x in (1,3) and x = >> any(array[1,3]) are two different things for sure, but in which way are >> they going to be mixed together because of this

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Dmitry Dolgov
> On Mon, Mar 14, 2022 at 11:02:16AM -0400, Robert Haas wrote: > On Mon, Mar 14, 2022 at 10:57 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > Well, yeah, the commit message is somewhat clumsy in this regard. It > > works almost in the way you've described, except if the list is all > >

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Robert Haas
On Mon, Mar 14, 2022 at 10:57 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > Well, yeah, the commit message is somewhat clumsy in this regard. It > works almost in the way you've described, except if the list is all > constants and long enough to satisfy the threshold then *first N > elements

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Dmitry Dolgov
> On Mon, Mar 14, 2022 at 10:17:57AM -0400, Robert Haas wrote: > On Sat, Mar 12, 2022 at 9:11 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > Here is the limited version of list collapsing functionality, which > > doesn't utilize eval_const_expressions and ignores most of the stuff > > except

Re: pg_stat_statements and "IN" conditions

2022-03-14 Thread Robert Haas
On Sat, Mar 12, 2022 at 9:11 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > Here is the limited version of list collapsing functionality, which > doesn't utilize eval_const_expressions and ignores most of the stuff > except ArrayExprs. Any thoughts/more suggestions? The proposed commit message

Re: pg_stat_statements and "IN" conditions

2022-03-12 Thread Dmitry Dolgov
> On Thu, Mar 10, 2022 at 12:11:59PM -0500, Tom Lane wrote: > Dmitry Dolgov <9erthali...@gmail.com> writes: > > New status: Waiting on Author > > > This seems incorrect, as the only feedback I've got was "this is a bad > > idea", and no reaction on follow-up questions. > > I changed the status

Re: pg_stat_statements and "IN" conditions

2022-03-10 Thread Dmitry Dolgov
> On Thu, Mar 10, 2022 at 12:32:08PM -0500, Robert Haas wrote: > On Thu, Mar 10, 2022 at 12:12 PM Tom Lane wrote: > > > 2. You haven't made a case for it. The original complaint was > > about different lengths of IN lists not being treated as equivalent, > > but this patch has decided to do

Re: pg_stat_statements and "IN" conditions

2022-03-10 Thread Robert Haas
On Thu, Mar 10, 2022 at 12:12 PM Tom Lane wrote: > > This seems incorrect, as the only feedback I've got was "this is a bad > > idea", and no reaction on follow-up questions. > > I changed the status because it seems to me there is no chance of > this being committed as-is. > > 1. I think an

Re: pg_stat_statements and "IN" conditions

2022-03-10 Thread Tom Lane
Dmitry Dolgov <9erthali...@gmail.com> writes: > New status: Waiting on Author > This seems incorrect, as the only feedback I've got was "this is a bad > idea", and no reaction on follow-up questions. I changed the status because it seems to me there is no chance of this being committed as-is.

Re: pg_stat_statements and "IN" conditions

2022-03-10 Thread Dmitry Dolgov
> On Wed, Jan 05, 2022 at 10:11:11PM +0100, Dmitry Dolgov wrote: > > On Tue, Jan 04, 2022 at 06:02:43PM -0500, Tom Lane wrote: > > We can debate whether the rules proposed here are good for > > pg_stat_statements or not, but it seems inevitable that they will be a > > disaster for some other

Re: pg_stat_statements and "IN" conditions

2022-01-05 Thread Dmitry Dolgov
> On Tue, Jan 04, 2022 at 06:02:43PM -0500, Tom Lane wrote: > We can debate whether the rules proposed here are good for > pg_stat_statements or not, but it seems inevitable that they will be a > disaster for some other consumers of the query hash. Hm, which consumers do you mean here, potential

Re: pg_stat_statements and "IN" conditions

2022-01-04 Thread Tom Lane
"Andrey V. Lepikhov" writes: > On 1/5/22 4:02 AM, Tom Lane wrote: >> I've been saying from day one that pushing the query-hashing code into the >> core was a bad idea, and I think this patch perfectly illustrates why. > +1. > Let me suggest, that the core should allow an extension at least to

Re: pg_stat_statements and "IN" conditions

2022-01-04 Thread Andrey V. Lepikhov
On 1/5/22 4:02 AM, Tom Lane wrote: Dmitry Dolgov <9erthali...@gmail.com> writes: And now for something completely different, here is a new patch version. It contains a small fix for one problem we've found during testing (one path code was incorrectly assuming find_const_walker results). I've

Re: pg_stat_statements and "IN" conditions

2022-01-04 Thread Tom Lane
Dmitry Dolgov <9erthali...@gmail.com> writes: > And now for something completely different, here is a new patch version. > It contains a small fix for one problem we've found during testing (one > path code was incorrectly assuming find_const_walker results). I've been saying from day one that

Re: pg_stat_statements and "IN" conditions

2021-09-30 Thread Dmitry Dolgov
> On Thu, Sep 30, 2021 at 08:03:16AM -0700, Zhihong Yu wrote: > On Thu, Sep 30, 2021 at 6:49 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > >On Wed, Jun 16, 2021 at 04:02:12PM +0200, Dmitry Dolgov wrote: > > > > > > > I've prepared a new rebased version to deal with the new way of > > > >

Re: pg_stat_statements and "IN" conditions

2021-09-30 Thread Zhihong Yu
On Thu, Sep 30, 2021 at 6:49 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > >On Wed, Jun 16, 2021 at 04:02:12PM +0200, Dmitry Dolgov wrote: > > > > > I've prepared a new rebased version to deal with the new way of > > > computing query id, but as always there is one tricky part. From what I >

Re: pg_stat_statements and "IN" conditions

2021-09-30 Thread Dmitry Dolgov
>On Wed, Jun 16, 2021 at 04:02:12PM +0200, Dmitry Dolgov wrote: > > > I've prepared a new rebased version to deal with the new way of > > computing query id, but as always there is one tricky part. From what I > > understand, now an external module can provide custom implementation for > > query

Re: pg_stat_statements and "IN" conditions

2021-06-16 Thread Dmitry Dolgov
> On Tue, Jun 15, 2021 at 05:18:50PM +0200, Dmitry Dolgov wrote: > > On Thu, Mar 18, 2021 at 04:50:02PM +0100, Dmitry Dolgov wrote: > > > On Thu, Mar 18, 2021 at 09:38:09AM -0400, David Steele wrote: > > > On 1/5/21 10:51 AM, Zhihong Yu wrote: > > > > > > > > +   int         lastExprLenght = 0; >

Re: pg_stat_statements and "IN" conditions

2021-06-15 Thread Dmitry Dolgov
> On Thu, Mar 18, 2021 at 04:50:02PM +0100, Dmitry Dolgov wrote: > > On Thu, Mar 18, 2021 at 09:38:09AM -0400, David Steele wrote: > > On 1/5/21 10:51 AM, Zhihong Yu wrote: > > > > > > +   int         lastExprLenght = 0; > > > > > > Did you mean to name the variable lastExprLenghth ? > > > > > >

Re: pg_stat_statements and "IN" conditions

2021-03-18 Thread Dmitry Dolgov
> On Thu, Mar 18, 2021 at 09:38:09AM -0400, David Steele wrote: > On 1/5/21 10:51 AM, Zhihong Yu wrote: > > > > +   int         lastExprLenght = 0; > > > > Did you mean to name the variable lastExprLenghth ? > > > > w.r.t. extracting to helper method, the second and third > > if (currentExprIdx ==

Re: pg_stat_statements and "IN" conditions

2021-03-18 Thread David Steele
On 1/5/21 10:51 AM, Zhihong Yu wrote: +   int         lastExprLenght = 0; Did you mean to name the variable lastExprLenghth ? w.r.t. extracting to helper method, the second and third if (currentExprIdx == pgss_merge_threshold - 1) blocks are similar. It is up to you whether to create the

Re: pg_stat_statements and "IN" conditions

2021-01-05 Thread Zhihong Yu
Hi, Dmitry: + int lastExprLenght = 0; Did you mean to name the variable lastExprLenghth ? w.r.t. extracting to helper method, the second and third if (currentExprIdx == pgss_merge_threshold - 1) blocks are similar. It is up to you whether to create the helper method. I am fine with

Re: pg_stat_statements and "IN" conditions

2021-01-05 Thread Dmitry Dolgov
> On Sat, Dec 26, 2020 at 08:53:28AM -0800, Zhihong Yu wrote: > Hi, > A few comments. > > + foreach(lc, (List *) expr) > + { > + Node * subExpr = (Node *) lfirst(lc); > + > + if (!IsA(subExpr, Const)) > + { > +

Re: pg_stat_statements and "IN" conditions

2020-12-26 Thread Zhihong Yu
Hi, A few comments. + "After this number of duplicating constants start to merge them.", duplicating -> duplicate + foreach(lc, (List *) expr) + { + Node * subExpr = (Node *) lfirst(lc); + + if

Re: pg_stat_statements and "IN" conditions

2020-12-26 Thread Dmitry Dolgov
> On Wed, Nov 18, 2020 at 05:04:32PM +0100, Dmitry Dolgov wrote: > > On Wed, Aug 12, 2020 at 06:19:02PM +0200, Dmitry Dolgov wrote: > > > > I would like to start another thread to follow up on [1], mostly to bump up > > the > > topic. Just to remind, it's about how pg_stat_statements jumbling

Re: pg_stat_statements and "IN" conditions

2020-12-09 Thread Dmitry Dolgov
> On Wed, Dec 09, 2020 at 03:37:40AM +, Chengxi Sun wrote: > > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: not tested > Documentation:not

Re: pg_stat_statements and "IN" conditions

2020-12-09 Thread Chengxi Sun
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:not tested Hi, I did some test and it works well

Re: pg_stat_statements and "IN" conditions

2020-11-18 Thread Dmitry Dolgov
> On Wed, Aug 12, 2020 at 06:19:02PM +0200, Dmitry Dolgov wrote: > > I would like to start another thread to follow up on [1], mostly to bump up > the > topic. Just to remind, it's about how pg_stat_statements jumbling ArrayExpr in > queries like: > > SELECT something FROM table WHERE col IN

pg_stat_statements and "IN" conditions

2020-08-12 Thread Dmitry Dolgov
Hi I would like to start another thread to follow up on [1], mostly to bump up the topic. Just to remind, it's about how pg_stat_statements jumbling ArrayExpr in queries like: SELECT something FROM table WHERE col IN (1, 2, 3, ...) The current implementation produces different jumble hash