Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-11 Thread John Naylor
On Wed, Jan 11, 2023 at 1:38 PM Ankit Kumar Pandey wrote: > > > > On 11/01/23 09:57, Tom Lane wrote: > > IME it's typically a lot more productive to approach things via > > "scratch your own itch". If a problem is biting you directly, then > > at least you have some clear idea of what it is that

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-10 Thread Ankit Kumar Pandey
On 11/01/23 09:57, Tom Lane wrote: IME it's typically a lot more productive to approach things via "scratch your own itch". If a problem is biting you directly, then at least you have some clear idea of what it is that needs to be fixed. You might have to work up to an understanding of how to

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-10 Thread Tom Lane
John Naylor writes: > Note that the TODO list has accumulated some cruft over the years. Some > time ago I started an effort to remove outdated/undesirable entries, and I > should get back to that, but for the present, please take the warning at > the top to heart: > "WARNING for Developers:

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-10 Thread John Naylor
On Tue, Jan 3, 2023 at 1:59 PM Ankit Kumar Pandey wrote: > > > On 03/01/23 08:38, David Rowley wrote: > > > > Do you actually have a need for this or are you just trying to tick > > off some TODO items? > > > I would say Iatter but reason I picked it up was more on side of > learning optimizer

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-04 Thread Ankit Kumar Pandey
On 04/01/23 06:27, David Rowley wrote: I think it's better you leave this then. I think if someone comes along and demonstrates the feature's usefulness and can sell us having it so we can easily enable it by GUC then maybe that's the time to consider it. I don't think ticking off a TODO item

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-04 Thread Vladimir Churyukin
On Tue, Jan 3, 2023 at 9:55 PM Tom Lane wrote: > David Rowley writes: > > The thing I had in mind was some mode that would record additional > > details during planning that could be tagged onto the final plan in > > createplan.c so that EXPLAIN could display them. I just think that > > EXPLAIN

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-03 Thread Tom Lane
David Rowley writes: > The thing I had in mind was some mode that would record additional > details during planning that could be tagged onto the final plan in > createplan.c so that EXPLAIN could display them. I just think that > EXPLAIN is the place where people go to learn about _what_ the

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-03 Thread David Rowley
On Wed, 4 Jan 2023 at 17:39, Vladimir Churyukin wrote: > > On Tue, Jan 3, 2023 at 7:41 PM David Rowley wrote: >> From what I can see here, the motivation to make this a useful feature >> is backwards from what is normal. I think if you're keen to see a >> feature that allows you better

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-03 Thread Vladimir Churyukin
On Tue, Jan 3, 2023 at 7:41 PM David Rowley wrote: > On Wed, 4 Jan 2023 at 16:15, Vladimir Churyukin > wrote: > > As an end user that spends a lot of time optimizing pretty complicated > queries, I'd say that something like this could be useful. > > I think we really need to at least see that

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-03 Thread David Rowley
On Wed, 4 Jan 2023 at 16:15, Vladimir Churyukin wrote: > As an end user that spends a lot of time optimizing pretty complicated > queries, I'd say that something like this could be useful. I think we really need to at least see that it *is* useful, not that it *could be* useful. For example,

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-03 Thread Vladimir Churyukin
As an end user that spends a lot of time optimizing pretty complicated queries, I'd say that something like this could be useful. Right now the optimizer is mostly a black box. Why it chooses one plan or the other, it's a mystery. I have some general ideas about that, and I can even read and

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-03 Thread David Rowley
On Tue, 3 Jan 2023 at 19:59, Ankit Kumar Pandey wrote: > > > On 03/01/23 08:38, David Rowley wrote: > > Do you actually have a need for this or are you just trying to tick > > off some TODO items? > > > I would say Iatter but reason I picked it up was more on side of > learning optimizer better.

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-02 Thread Ankit Kumar Pandey
On 03/01/23 08:38, David Rowley wrote: I'm with Tom on this. I've never once used this feature to try to figure out why a certain plan was chosen or not chosen. I'd really rather not see us compiling all that debug code in by default unless it's actually going to be useful to a meaningful

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2023-01-02 Thread David Rowley
On Mon, 26 Dec 2022 at 08:05, Ankit Kumar Pandey wrote: > Also, inputs from other hackers are welcomed here. I'm with Tom on this. I've never once used this feature to try to figure out why a certain plan was chosen or not chosen. Do you actually have a need for this or are you just trying to

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2022-12-25 Thread Ankit Kumar Pandey
On 25/12/22 23:54, Tom Lane wrote: These days people would probably also wish that the output could be machine- readable in some way (JSON-formatted, perhaps). Perhaps switch to enable logs could be on (standard logging style), json, xml etc and print the output as required?

Re: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2022-12-25 Thread Tom Lane
Ankit Kumar Pandey writes: > As per as suggestion in the mailing list which is to replace current > mechanism of getting optimizer log via OPTIMIZER_DEBUG macro > to something more configurable (which doesn't require rebuilding > postgres from source code). This patch replaces /OPTIMIZER_DEBUG

[PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

2022-12-25 Thread Ankit Kumar Pandey
is appreciated. -- Regards, Ankit Kumar Pandey From 420f0ed81d233bf63a10104d1164726b138bce83 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Pandey Date: Sun, 25 Dec 2022 21:26:32 +0530 Subject: [PATCH] Improve ability to display optimizer analysis using OPTIMIZER_DEBUG Currently optimizer logs are enabled