Hi, On 2019-11-13 14:29:07 -0500, Robert Haas wrote: > On Mon, Oct 28, 2019 at 7:21 PM Andres Freund <and...@anarazel.de> wrote: > > Because that's the normal way to represent something non-existing for > > formats like json? There's a lot of information we show always for !text > > format, even if not really applicable to the context (e.g. Triggers for > > select statements). I think there's an argument to made to deviate in > > this case, but I don't think it's obvious. > > I've consistently been of the view that anyone who thinks that the > FORMAT option should affect what information gets displayed doesn't > understand the meaning of the word "format." And I still feel that > way.
Well, it's not been that way since the format option was added, so ... > I also think that conditionally renaming "Output" to "Project" is a > super-bad idea. The idea of a format like this is that the "keys" stay > constant and the values change. If you need to tell people more, you > add more keys. Yea, I don't like the compat break either. But I'm not so convinced that just continuing to collect cruft because of compatibility is worth it - I just don't see an all that high reliance interest for explain output. I think adding a new key is somewhat ok for !text, but for text that doesn't seem like an easy solution? I kind of like my idea somewhere downthread, in a reply to Maciek, of simply not listing "Output" for nodes that don't project. While that's still a format break, it seems that tools already need to deal with "Output" not being present? > I also think that making the Filter field a group conditionally is a > bad idea, for similar reasons. Oh, yea, it's utterly terrible (I called it crappy in my email :)). > But making it always be a group doesn't necessarily seem like a bad > idea. I think, though, that you could handle this in other ways, like > by suffixing existing keys. e.g. if you've got Index-Qual and Filter, > just do Index-Qual-JIT and Filter-JIT and call it good. Maciek suggested the same. But to me it seems going down that way will make the format harder and harder to understand? So I think I'd rather break compat here, and go for a group. Personally I think the group naming choice for explain makes the the !text outputs much less useful than they could be - we basically force every tool to understand all possible keys, to make sense of formatted output. Instead of something like 'Filter: {"Qual":{"text" : "...", "JIT": ...}' where a tool only needed to understand that everything that has a "Qual" inside is a filtering expression, everything that has a "Project" is a projecting type of expression, ... a tool needs to know about "Inner Cond", "Order By", "Filter", "Recheck Cond", "TID Cond", "Join Filter", "Merge Cond", "Hash Cond", "One-Time Filter", ... Greetings, Andres Freund