Re: [HACKERS] machine-readable explain output v4

2009-08-13 Thread Greg Smith
On Tue, 11 Aug 2009, Mike wrote: Have any tool authors stepped up and committed resources to utilizing this feature in the near term? Even before the easier to read format was available, there were already multiple EXPLAIN analysis tools floating around, some of them web-based like you're

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Csaba Nagy
On Tue, 2009-08-11 at 23:58 +0200, Andrew Dunstan wrote: Well, I don't think that the fact that we are producing machine-readable output means we can just ignore the human side of it. It is more than likely that such output will be read by both machines and humans. Obviously, we need to

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Andrew Dunstan
Csaba Nagy wrote: On Tue, 2009-08-11 at 23:58 +0200, Andrew Dunstan wrote: Well, I don't think that the fact that we are producing machine-readable output means we can just ignore the human side of it. It is more than likely that such output will be read by both machines and humans.

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Robert Haas
On Wed, Aug 12, 2009 at 9:42 AM, Andrew Dunstanand...@dunslane.net wrote: Csaba Nagy wrote: On Tue, 2009-08-11 at 23:58 +0200, Andrew Dunstan wrote: Well, I don't think that the fact that we are producing machine-readable output means we can just ignore the human side of it. It is more than

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Another design issue is this: The root node of an XML document is ideally a distinguished element that can't occur within itself. auto-explain doesn't seem to be doing this. Huh? I get (for explain 2+2) explain

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Robert Haas
On Wed, Aug 12, 2009 at 10:01 AM, Tom Lanet...@sss.pgh.pa.us wrote: Andrew Dunstan and...@dunslane.net writes: Another design issue is this: The root node of an XML document is ideally a distinguished element that can't occur within itself. auto-explain doesn't seem to be doing this. Huh?  I

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Csaba Nagy
On Wed, 2009-08-12 at 15:42 +0200, Andrew Dunstan wrote: Have you actually looked at a logfile with this in it? A simple stylesheet won't do at all. What you get is not an XML document but a text document with little bits of XML embedded in it. So you would need a program to parse that file

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Csaba Nagy
On Wed, 2009-08-12 at 16:51 +0200, Csaba Nagy wrote: I argue that a sufficiently complicated explain output will never be easily navigated in a text browser, however much you would like it. If you do a where clause with 100 nested ANDs (which occasionally happens here), I don't think you'll be

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Andrew Dunstan
Csaba Nagy wrote: On Wed, 2009-08-12 at 15:42 +0200, Andrew Dunstan wrote: Have you actually looked at a logfile with this in it? A simple stylesheet won't do at all. What you get is not an XML document but a text document with little bits of XML embedded in it. So you would need a

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Alvaro Herrera
Andrew Dunstan escribió: STATEMENT: SELECT 1 AS one; LOG: duration: 0.008 ms plan: Plan Node-TypeResult/Node-Type Startup-Cost0.00/Startup-Cost Total-Cost0.01/Total-Cost Plan-Rows1/Plan-Rows Plan-Width0/Plan-Width /Plan I think what this says is that

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Andrew Dunstan
Alvaro Herrera wrote: Andrew Dunstan escribió: STATEMENT: SELECT 1 AS one; LOG: duration: 0.008 ms plan: Plan Node-TypeResult/Node-Type Startup-Cost0.00/Startup-Cost Total-Cost0.01/Total-Cost Plan-Rows1/Plan-Rows Plan-Width0/Plan-Width /Plan I

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Csaba Nagy
On Wed, 2009-08-12 at 17:11 +0200, Andrew Dunstan wrote: That will just make things worse. And it will break if the XML includes any expression that contains a line break. Then escape the expressions using CDATA or such... I'm sure it would be possible to make sure it's one line and rely on

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Mike
On Wed, 12 Aug 2009 09:42:00 -0400 Andrew Dunstan and...@dunslane.net wrote: One thing I have noticed that we should talk about is that the explain XML output doesn't contain the query that is being explained. That's unfortunate - it means that any logfile processor will need to extract the

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Csaba Nagy
On Wed, 2009-08-12 at 17:31 +0200, Csaba Nagy wrote: On Wed, 2009-08-12 at 17:11 +0200, Andrew Dunstan wrote: That will just make things worse. And it will break if the XML includes any expression that contains a line break. Then escape the expressions using CDATA or such... I'm sure it

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Csaba Nagy
On Wed, 2009-08-12 at 17:41 +0200, Andrew Dunstan wrote: Csaba Nagy wrote: Then why you bother calling it machine readable at all ? Would you really read your auto-explain output on the DB server ? I doubt that's the common usage scenario, I would expect that most people would let a

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Andrew Dunstan
Csaba Nagy wrote: Then why you bother calling it machine readable at all ? Would you really read your auto-explain output on the DB server ? I doubt that's the common usage scenario, I would expect that most people would let a tool extract/summarize it and definitely process it somewhere else

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Andrew Dunstan
Csaba Nagy wrote: On Wed, 2009-08-12 at 17:11 +0200, Andrew Dunstan wrote: That will just make things worse. And it will break if the XML includes any expression that contains a line break. Then escape the expressions using CDATA or such... I'm sure it would be possible to make sure

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Csaba Nagy
On Wed, 2009-08-12 at 18:07 +0200, Andrew Dunstan wrote: Csaba Nagy wrote: On Wed, 2009-08-12 at 17:11 +0200, Andrew Dunstan wrote: Well, the right solution would actually be NOT to use CDATA but to replace a literal linefeed with the XML numeric escape #x0a; , but I really don't think

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I think I might be starting to understand what you're getting at here. Let me check: I think what you're saying is that the Expr node is potentially useful to clients for identifying where in the tree the Exprs are, even without specific knowledge

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Robert Haas
On Tue, Aug 11, 2009 at 12:11 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I think I might be starting to understand what you're getting at here.  Let me check: I think what you're saying is that the Expr node is potentially useful to clients for identifying

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Mike
On Tue, 11 Aug 2009 13:11:47 -0400 Robert Haas robertmh...@gmail.com wrote: Unfortunately, I have to admit to total confusion. The idea in the last paragraph seems reasonable to me, but since I don't understand the other alternative, I can't say whether it's better or worse. I wonder if we

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Tom Lane
Mike i...@snappymail.ca writes: Have any tool authors stepped up and committed resources to utilizing this feature in the near term? I don't think anyone's promised much. If you want to have a go at using it, we'd be very happy. I'm guessing that my vision likely exceeds the scope of this

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Andrew Dunstan
Tom Lane wrote: Mike i...@snappymail.ca writes: Have any tool authors stepped up and committed resources to utilizing this feature in the near term? I don't think anyone's promised much. If you want to have a go at using it, we'd be very happy. I'm guessing that my vision

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Andres Freund
On Tuesday 11 August 2009 21:59:48 Andrew Dunstan wrote: Tom Lane wrote: Mike i...@snappymail.ca writes: Have any tool authors stepped up and committed resources to utilizing this feature in the near term? I don't think anyone's promised much. If you want to have a go at using it,

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Robert Haas
On Tue, Aug 11, 2009 at 3:59 PM, Andrew Dunstanand...@dunslane.net wrote: Good. I had a look at this for a little while yesterday. I built it, did an install, loaded auto_explain and then ran the regression tests. I didn't like the output much. It looks like the XML has been dumbed down to fit

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: Andrew Dunstanand...@dunslane.net wrote: find it more tiresome to read. In effect we are swapping horizontal expansion for vertical expansion. It would be nicer to be able to fit a plan into a screen. Isn't that what text format is for? In my

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Andrew Dunstan
Robert Haas wrote: On Tue, Aug 11, 2009 at 3:59 PM, Andrew Dunstanand...@dunslane.net wrote: Good. I had a look at this for a little while yesterday. I built it, did an install, loaded auto_explain and then ran the regression tests. I didn't like the output much. It looks like the XML has

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Stefan Kaltenbrunner
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: I takle it back. It's still there at http://archives.postgresql.org/pgsql-hackers/2009-08/msg00485.php posted 3 days ago. Hmm, I think the archive website must be mangling that somehow. What I have in the code I'm reviewing is

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 1:56 AM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Revised patch attached.  I'm not convinced this is as good as it can be, but I've been looking at this patch for so long that I'm starting to get cross-eyed, and I'd like to Tom at

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Andrew Dunstan
Andres Freund wrote: I produced/mailed a relaxng version for a a bit older version and I plan to refresh and document it once the format seems suitably stable. I am not sure it is yet. If yes, this should not take that long... (Relaxng because you easily can convert it into most other XML

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Andres Freund
On Monday 10 August 2009 14:39:22 Andrew Dunstan wrote: Andres Freund wrote: I produced/mailed a relaxng version for a a bit older version and I plan to refresh and document it once the format seems suitably stable. I am not sure it is yet. If yes, this should not take that long...

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Andrew Dunstan
Andres Freund wrote: On Monday 10 August 2009 14:39:22 Andrew Dunstan wrote: Andres Freund wrote: I produced/mailed a relaxng version for a a bit older version and I plan to refresh and document it once the format seems suitably stable. I am not sure it is yet. If yes, this should

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 1:56 AM, Tom Lanet...@sss.pgh.pa.us wrote: There are still some open issues: * I still think we need a written spec for the non-text output formats. Where would we put this in the documentation? Seems like it might need a

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 10:54 AM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 1:56 AM, Tom Lanet...@sss.pgh.pa.us wrote: There are still some open issues: * I still think we need a written spec for the non-text output formats. Where

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 10:54 AM, Tom Lanet...@sss.pgh.pa.us wrote: FilterExprText(f1 gt; 0)/Text/Expr/Filter This would leave room to add additional properties beside the text, and not break existing clients when we do it. Well, there you

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Alvaro Herrera
Robert Haas escribió: What the hell? I have every version of that patch I've ever submitted in ~/patch/explain-as-submitted, and that extra semicolon is not there in any of them. Furthermore, when I open up the attachment from my sent mail, the semicolon isn't there either. Yet I see it at

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 12:13 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 10:54 AM, Tom Lanet...@sss.pgh.pa.us wrote:        FilterExprText(f1 gt; 0)/Text/Expr/Filter This would leave room to add additional properties beside the

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 12:13 PM, Tom Lanet...@sss.pgh.pa.us wrote: Uh, no, I see one container and a property. If we do just FilterExpr(f1 gt; 0)/Expr/Filter then where do we put additional information about the expression when the time

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 12:47 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 12:13 PM, Tom Lanet...@sss.pgh.pa.us wrote: Uh, no, I see one container and a property.  If we do just        FilterExpr(f1 gt; 0)/Expr/Filter then where do

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I may be thick as a post here and say oh, I'm a moron when you explain this to me, but I still don't understand why that would require the XML notation to interpose an intermediate node. Why can't filter node itself can be the labelled container?

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 1:45 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I may be thick as a post here and say oh, I'm a moron when you explain this to me, but I still don't understand why that would require the XML notation to interpose an intermediate

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 1:45 PM, Tom Lanet...@sss.pgh.pa.us wrote: The way we have this set up, there's a distinction between properties and groups, which AFAICS we have to have in order to have directly comparable structures in XML and JSON.  Didn't

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 7:57 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Mon, Aug 10, 2009 at 1:45 PM, Tom Lanet...@sss.pgh.pa.us wrote: The way we have this set up, there's a distinction between properties and groups, which AFAICS we have to have in

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Revised patch attached. I'm not convinced this is as good as it can be, but I've been looking at this patch for so long that I'm starting to get cross-eyed, and I'd like to Tom at least have a look at this and assess it before we run out of

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 3:57 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Revised patch attached.  I'm not convinced this is as good as it can be, but I've been looking at this patch for so long that I'm starting to get cross-eyed, and I'd like to Tom at least

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andrew Dunstan
Robert Haas wrote: The one significant representational choice that I'm aware of having made is to use nested tags rather than attributes in the XML format. This seems to me to offer several advantages. First, it's clearly impossible to standardize on attributes, because attributes can only

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andres Freund
On Monday 10 August 2009 01:21:35 Andrew Dunstan wrote: Robert Haas wrote: The one significant representational choice that I'm aware of having made is to use nested tags rather than attributes in the XML format. This seems to me to offer several advantages. First, it's clearly

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andrew Dunstan
Andres Freund wrote: BTW, has anyone tried validating the XML at all? I just looked very briefly at the patch at http://archives.postgresql.org/pgsql-hackers/2009-07/msg01944.php and I noticed this which makes me suspicious: + if (es.format == EXPLAIN_FORMAT_XML) +

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andrew Dunstan
Andrew Dunstan wrote: Andres Freund wrote: BTW, has anyone tried validating the XML at all? I just looked very briefly at the patch at http://archives.postgresql.org/pgsql-hackers/2009-07/msg01944.php and I noticed this which makes me suspicious: + if (es.format == EXPLAIN_FORMAT_XML)

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Andres Freund and...@anarazel.de writes: On Monday 10 August 2009 01:21:35 Andrew Dunstan wrote: That ; after the attribute is almost certainly wrong. This is a classic case of what I was talking about a month or two ago. Building up XML (or any structured doc, really, XML is not special in

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andres Freund
On Monday 10 August 2009 02:48:29 Andrew Dunstan wrote: Andrew Dunstan wrote: Andres Freund wrote: BTW, has anyone tried validating the XML at all? I just looked very briefly at the patch at http://archives.postgresql.org/pgsql-hackers/2009-07/msg01944.php and I noticed this which makes

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 8:48 PM, Andrew Dunstanand...@dunslane.net wrote: Andrew Dunstan wrote: Andres Freund wrote: BTW, has anyone tried validating the XML at all? I just looked very briefly at the patch at http://archives.postgresql.org/pgsql-hackers/2009-07/msg01944.php and I noticed

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: I takle it back. It's still there at http://archives.postgresql.org/pgsql-hackers/2009-08/msg00485.php posted 3 days ago. Hmm, I think the archive website must be mangling that somehow. What I have in the code I'm reviewing is if (es.format ==

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 9:03 PM, Tom Lanet...@sss.pgh.pa.us wrote: Andrew Dunstan and...@dunslane.net writes: I takle it back. It's still there at http://archives.postgresql.org/pgsql-hackers/2009-08/msg00485.php posted 3 days ago. Hmm, I think the archive website must be mangling that

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 8:53 PM, Tom Lanet...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: On Monday 10 August 2009 01:21:35 Andrew Dunstan wrote: That ; after the attribute is almost certainly wrong. This is a classic case of what I was talking about a month or two ago.

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andres Freund
On Monday 10 August 2009 02:53:16 Tom Lane wrote: Andres Freund and...@anarazel.de writes: On Monday 10 August 2009 01:21:35 Andrew Dunstan wrote: That ; after the attribute is almost certainly wrong. This is a classic case of what I was talking about a month or two ago. Building up XML

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Andres Freund and...@anarazel.de writes: Adding the notion of opening a 'empty' Group together with X_OPENCLOSE or handling of X_OPENING|X_CLOSING would allow to handle empty tags like in ExplainOneUtility (Notify /). Yeah, I was just wondering what to do with the Notify / code. I'm not

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 9:32 PM, Tom Lanet...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: Adding the notion of opening a 'empty' Group together with X_OPENCLOSE or handling of X_OPENING|X_CLOSING would allow to handle empty tags like in ExplainOneUtility (Notify /). Yeah, I

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andres Freund
On Monday 10 August 2009 03:34:36 Robert Haas wrote: On Sun, Aug 9, 2009 at 9:32 PM, Tom Lanet...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: Adding the notion of opening a 'empty' Group together with X_OPENCLOSE or handling of X_OPENING|X_CLOSING would allow to handle

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andrew Dunstan
Robert Haas wrote: One subtle point that isn't documented and probably should be is that JSON can't support a container that behaves partly like a list and partly like a hash, as XML can. So for example in XML a Plan tag could have children like Startup-Cost (one each) and could also have its

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Andres Freund
On Monday 10 August 2009 03:43:22 Andres Freund wrote: On Monday 10 August 2009 03:34:36 Robert Haas wrote: On Sun, Aug 9, 2009 at 9:32 PM, Tom Lanet...@sss.pgh.pa.us wrote: Andres Freund and...@anarazel.de writes: Adding the notion of opening a 'empty' Group together with X_OPENCLOSE

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Revised patch attached. I'm not convinced this is as good as it can be, but I've been looking at this patch for so long that I'm starting to get cross-eyed, and I'd like to Tom at least have a look at this and assess it before we run out of

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Robert Haas
On Sun, Aug 2, 2009 at 7:57 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: The reason for this regression is that Tom asked me to change ExplainStmt to just carry a list of nodes and to do all the parsing in ExplainQuery.  Unfortunately, the TupleDesc is

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Andrew Dunstan
Robert Haas wrote: On Sun, Aug 2, 2009 at 7:57 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: The reason for this regression is that Tom asked me to change ExplainStmt to just carry a list of nodes and to do all the parsing in ExplainQuery.

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Robert Haas
On Wed, Aug 5, 2009 at 7:20 AM, Andrew Dunstanand...@dunslane.net wrote: Robert Haas wrote: On Sun, Aug 2, 2009 at 7:57 PM, Tom Lanet...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: The reason for this regression is that Tom asked me to change ExplainStmt to just carry a

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: (2) Is it worth making this work? No, I don't think so. The odds of such a test ever showing anything interesting seem minimal. plpgsql's inability to cope with the case would be nice to fix, but I'm not holding my breath for it...

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Robert Haas
On Sun, Aug 2, 2009 at 7:29 PM, Andres Freundand...@anarazel.de wrote: Well, the whole explain output format is pretty idiosyncratic, and I had to work pretty hard to beat it into submission.  I think that it would not be totally trivial to do what you're suggesting here because it would

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Andres Freund
Hi Robert, Hi all, On Thursday 30 July 2009 05:05:48 Robert Haas wrote: OK, here's the updated version of my machine-readable explain output patch. This needed heavy updating as a result of the changes that Tom asked me to make to the explain options patch, and the further changes he made

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Robert Haas
On Sun, Aug 2, 2009 at 12:06 PM, Andres Freundand...@anarazel.de wrote: Hi Robert, Hi all, On Thursday 30 July 2009 05:05:48 Robert Haas wrote: OK, here's the updated version of my machine-readable explain output patch.  This needed heavy updating as a result of the changes that Tom asked me

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sun, Aug 2, 2009 at 12:06 PM, Andres Freundand...@anarazel.de wrote: - Currently a value scan looks like »Values Scan on *VALUES*« What about adding its alias at least in verbose mode? This currently is inconsistent with other scans. I don't

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Andres Freund
On Sunday 02 August 2009 23:34:04 Robert Haas wrote: On Sun, Aug 2, 2009 at 12:06 PM, Andres Freundand...@anarazel.de wrote: Hi Robert, Hi all, On Thursday 30 July 2009 05:05:48 Robert Haas wrote: OK, here's the updated version of my machine-readable explain output patch. This needed

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: The reason for this regression is that Tom asked me to change ExplainStmt to just carry a list of nodes and to do all the parsing in ExplainQuery.  Unfortunately, the TupleDesc is constructed by ExplainResultDesc() which can't trivially be changed to

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Andres Freund
On Monday 03 August 2009 01:57:48 Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: - The regression tests are gone? Tom added some that look adequate to me to create_index.sql, as a separate commit, so I don't think I need to do this in my patch any more. Maybe some of those

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Robert Haas
On Sun, Aug 2, 2009 at 7:57 PM, Tom Lanet...@sss.pgh.pa.us wrote: Well, of course the existing tests are not going to exercise XML or JSON output format.  Dunno how much we care.  I had supposed that XML or JSON would always emit all the fields and leave it to the recipient to suppress what

Re: [HACKERS] machine-readable explain output v2

2009-07-31 Thread Robert Haas
On Sat, Jul 18, 2009 at 10:29 PM, Andres Freundand...@anarazel.de wrote: One part where I find the code flow ugly is 'did_boilerplate' in report_triggers/its callsites. I can see why it is done that way, but its not exactly obvious to read when you want to find out how the format looks.

Re: [HACKERS] machine-readable explain output v2

2009-07-31 Thread Andres Freund
Hi Robert, On Friday 31 July 2009 23:13:54 Robert Haas wrote: On Sat, Jul 18, 2009 at 10:29 PM, Andres Freundand...@anarazel.de wrote: I have posted a new version of this patch on a separate thread; do you have time to re-review? Yes, I have seen it. I plan to spent some time on it tonight

Re: [HACKERS] machine-readable explain output v2

2009-07-31 Thread Andres Freund
On Friday 31 July 2009 23:13:54 Robert Haas wrote: On Sat, Jul 18, 2009 at 10:29 PM, Andres Freundand...@anarazel.de wrote: One part where I find the code flow ugly is 'did_boilerplate' in report_triggers/its callsites. I can see why it is done that way, but its not exactly obvious to read

Re: [HACKERS] machine-readable explain output v2

2009-07-31 Thread Robert Haas
On Fri, Jul 31, 2009 at 6:04 PM, Andres Freundand...@anarazel.de wrote: I am quite happy that the annoyance over a patch of mine helped you starting to work on this ;-) Thanks for all the work. You're welcome, thanks for all your reviewing. For the record, I wasn't annoyed BY the patch; I was

Re: [HACKERS] machine-readable explain output v2

2009-07-31 Thread Robert Haas
On Fri, Jul 31, 2009 at 5:36 PM, Andres Freundand...@anarazel.de wrote: Hi Robert, On Friday 31 July 2009 23:13:54 Robert Haas wrote: On Sat, Jul 18, 2009 at 10:29 PM, Andres Freundand...@anarazel.de wrote: I have posted a new version of this patch on a separate thread; do you have time to

Re: [HACKERS] machine-readable explain output v2

2009-07-19 Thread Andres Freund
Hi Robert, Hi All, On Sunday 19 July 2009 04:29:42 Andres Freund wrote: I did not yet look at the contrib/autoexplain portions. Will do that on Monday or so. Early Monday: Looks fine, except that the new auto_explain.log_format parameter is not documented. Andres -- Sent via pgsql-hackers

Re: [HACKERS] machine-readable explain output

2009-06-18 Thread Peter Eisentraut
On Thursday 18 June 2009 06:01:13 to...@tuxteam.de wrote: One of the common pitfalls of XML is that designers think first in terms of the XML representation before being clear on the abstract structure of what they want to represent The other aspect is that designing a useful XML format is

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread Peter Eisentraut
On Tuesday 16 June 2009 16:22:27 Robert Haas wrote: 1. It didn't seem very wise to go with the approach of trying to do EVERYTHING with attributes. If I did that, then I'd either get really long lines that were not easily readable, or I'd have to write some kind of complicated line wrapping

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread Robert Haas
On Wed, Jun 17, 2009 at 10:27 AM, Peter Eisentrautpete...@gmx.net wrote: On Tuesday 16 June 2009 16:22:27 Robert Haas wrote: 1. It didn't seem very wise to go with the approach of trying to do EVERYTHING with attributes.  If I did that, then I'd either get really long lines that were not

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread Andres Freund
On 06/17/2009 04:27 PM, Peter Eisentraut wrote: On Tuesday 16 June 2009 16:22:27 Robert Haas wrote: 1. It didn't seem very wise to go with the approach of trying to do EVERYTHING with attributes. If I did that, then I'd either get really long lines that were not easily readable, or I'd have to

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread Peter Eisentraut
On Tuesday 16 June 2009 22:51:37 Robert Haas wrote: I agree. I'm just not seeing the need for an *explicit* categorization contained within the data itself. For one thing, AIUI, that's the job of things like an XML Schema, which Andres Freund has already agreed to write, and I would expect

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread Peter Eisentraut
On Tuesday 16 June 2009 20:21:21 Tom Lane wrote: As a concrete example of what I'm thinking about, I'd hope that PgAdmin would be able to display a graphical summary of a plan tree, and then pop up measurements associated with one of the nodes when you right-click on that node. To do this, it

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread Robert Haas
On Wed, Jun 17, 2009 at 10:40 AM, Peter Eisentrautpete...@gmx.net wrote: On Tuesday 16 June 2009 20:21:21 Tom Lane wrote: As a concrete example of what I'm thinking about, I'd hope that PgAdmin would be able to display a graphical summary of a plan tree, and then pop up measurements associated

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Jun 17, 2009 at 04:32:51PM +0200, Andres Freund wrote: On 06/17/2009 04:27 PM, Peter Eisentraut wrote: On Tuesday 16 June 2009 16:22:27 Robert Haas wrote: 1. It didn't seem very wise to go with the approach of trying to do EVERYTHING with

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andres Freund
Hi, On 06/12/2009 07:15 AM, Robert Haas wrote: If you don't like the syntax, please argue about that on the generic explain options v2 thread. Let's try to use this thread to discuss the output format, about which I spent a good deal of time agonizing. I spent some time playing around with the

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Greg Stark
On Tue, Jun 16, 2009 at 12:19 PM, Andres Freundand...@anarazel.de wrote: Startup-Cost1710.98/Startup-Cost Total-Cost1710.98/Total-Cost Plan-Rows72398/Plan-Rows Plan-Width4/Plan-Width Actual-Startup-Time136.595/Actual-Startup-Time Actual-Total-Time136.595/Actual-Total-Time

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andres Freund
On 06/16/2009 02:14 PM, Greg Stark wrote: On Tue, Jun 16, 2009 at 12:19 PM, Andres Freundand...@anarazel.de wrote: Startup-Cost1710.98/Startup-Cost Total-Cost1710.98/Total-Cost Plan-Rows72398/Plan-Rows Plan-Width4/Plan-Width Actual-Startup-Time136.595/Actual-Startup-Time

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Robert Haas
On Tue, Jun 16, 2009 at 8:53 AM, Andres Freundand...@anarazel.de wrote: On 06/16/2009 02:14 PM, Greg Stark wrote: On Tue, Jun 16, 2009 at 12:19 PM, Andres Freundand...@anarazel.de  wrote: Startup-Cost1710.98/Startup-Cost Total-Cost1710.98/Total-Cost Plan-Rows72398/Plan-Rows

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andres Freund
On 06/16/2009 03:22 PM, Robert Haas wrote: Well, one problem with this is that the actual values are not costs, but times, and the estimated values are not times, but costs. The planner estimates the cost of operations on an arbitrary scale where the cost of a sequential page fetch is 1.0.

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andrew Dunstan
Robert Haas wrote: 3. We have existing precedent for this design pattern in, e.g. table_to_xml http://www.postgresql.org/docs/current/interactive/functions-xml.html Tables are flat, explain output is not. If there is a relationship between the items then that needs to be expressed in

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andres Freund
On 06/16/2009 03:45 PM, Andrew Dunstan wrote: 3. We have existing precedent for this design pattern in, e.g. table_to_xml http://www.postgresql.org/docs/current/interactive/functions-xml.html Tables are flat, explain output is not. Comparing Greg's approach with Robert's it seems to me that

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Robert Haas
On Tue, Jun 16, 2009 at 9:45 AM, Andrew Dunstanand...@dunslane.net wrote: Robert Haas wrote: 3. We have existing precedent for this design pattern in, e.g. table_to_xml http://www.postgresql.org/docs/current/interactive/functions-xml.html Tables are flat, explain output is not. If there

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Robert Haas
On Tue, Jun 16, 2009 at 10:30 AM, Andres Freundand...@anarazel.de wrote: How would you model something like: plans  plan ... /plan  plan ... /plan  ... /plans otherwise? There are potentially unlimited number of child nodes - AppendNode for example can have any number of them. Sure, you

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andrew Dunstan
Robert Haas wrote: If there is a relationship between the items then that needs to be expressed in the XML structure, either by use of child nodes or attributes. Relying on the sequence of nodes, if that's what you're doing, is not a good idea, and I'm not doing that. Period, full

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andres Freund
Hi, On 06/16/2009 04:32 PM, Robert Haas wrote: On Tue, Jun 16, 2009 at 10:30 AM, Andres Freundand...@anarazel.de wrote: How would you model something like: plans plan .../plan plan .../plan ... /plans otherwise? There are potentially unlimited number of child nodes - AppendNode for

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Robert Haas
On Tue, Jun 16, 2009 at 10:59 AM, Andrew Dunstanand...@dunslane.net wrote: Robert Haas wrote: If there is a relationship between the items then that needs to be expressed in the XML structure, either by use of child nodes or attributes. Relying on the sequence of nodes, if that's what

  1   2   >