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 co

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 , but I > really don't think

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 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 le

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 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 sur

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Mike
On Wed, 12 Aug 2009 09:42:00 -0400 Andrew Dunstan 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 statement from the

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 t

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: Result 0.00 0.01 1 0 I think what this says is that auto-explain should not be sending its output to the regular logfile, but somewhere else.

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: > > Result > 0.00 > 0.01 > 1 > 0 > I think what this says is that auto-explain should not be sending its output to the regular logfile, but somewhere else. The format you sh

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 progra

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

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 f

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Robert Haas
On Wed, Aug 12, 2009 at 10:01 AM, Tom Lane wrote: > Andrew Dunstan 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") > >

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Tom Lane
Andrew Dunstan 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") http://www.postgresql.org/2009/explain";>

Re: [HACKERS] machine-readable explain output v4

2009-08-12 Thread Robert Haas
On Wed, Aug 12, 2009 at 9:42 AM, Andrew Dunstan 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 lik

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. Obvio

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-11 Thread Andrew Dunstan
Robert Haas wrote: On Tue, Aug 11, 2009 at 3:59 PM, Andrew Dunstan 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

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Kevin Grittner
Robert Haas wrote: > Andrew Dunstan 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 experience XML which represents an

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Robert Haas
On Tue, Aug 11, 2009 at 3:59 PM, Andrew Dunstan 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 a > data model th

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 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 b

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Andrew Dunstan
Tom Lane wrote: Mike 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 scop

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Tom Lane
Mike 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 feature in > its i

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Mike
On Tue, 11 Aug 2009 13:11:47 -0400 Robert Haas 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 would be better of

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Robert Haas
On Tue, Aug 11, 2009 at 12:11 PM, Tom Lane wrote: > Robert Haas 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 ar

Re: [HACKERS] machine-readable explain output v4

2009-08-11 Thread Tom Lane
Robert Haas 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 about the different t

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 7:57 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Aug 10, 2009 at 1:45 PM, Tom Lane 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 X

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas writes: > On Mon, Aug 10, 2009 at 1:45 PM, Tom Lane 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 you design this >> yourself? > Ye

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 1:45 PM, Tom Lane wrote: > Robert Haas 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 i

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas 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? Filter isn't a no

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 12:47 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Aug 10, 2009 at 12:13 PM, Tom Lane wrote: >>> Uh, no, I see one container and a property.  If we do just >>> >>>        (f1 > 0) >>> >>> then where do we put additional information about the expression >>> when the

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas writes: > On Mon, Aug 10, 2009 at 12:13 PM, Tom Lane wrote: >> Uh, no, I see one container and a property. If we do just >> >>(f1 > 0) >> >> then where do we put additional information about the expression >> when the time comes? > I would assume you would just write: > (f

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 12:13 PM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Aug 10, 2009 at 10:54 AM, Tom Lane wrote: >>>        (f1 > 0) >>> >>> This would leave room to add additional properties beside the text, >>> and not break existing clients when we do it. > >> Well, there you seem t

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

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas writes: > On Mon, Aug 10, 2009 at 10:54 AM, Tom Lane wrote: >>(f1 > 0) >> >> This would leave room to add additional properties beside the text, >> and not break existing clients when we do it. > Well, there you seem to be adding TWO containers, which is probably > overkill.

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 10:54 AM, Tom Lane wrote: > Robert Haas writes: >> On Mon, Aug 10, 2009 at 1:56 AM, Tom Lane 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?  Seem

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Tom Lane
Robert Haas writes: > On Mon, Aug 10, 2009 at 1:56 AM, Tom Lane 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 new section/chapter somewhere.

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 not

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: 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 sche

Re: [HACKERS] machine-readable explain output v4

2009-08-10 Thread Robert Haas
On Mon, Aug 10, 2009 at 1:56 AM, Tom Lane wrote: > Robert Haas 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 asse

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Stefan Kaltenbrunner
Tom Lane wrote: Andrew Dunstan writes: I takle it back. It's still there at 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 == EX

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Robert Haas 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 CommitFest. Committed after

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 Lane wrote: > > > Andres Freund writes: > > >> Adding the notion of opening a 'empty' Group together with X_OPENCLOSE > > >> or handling of X_OPENIN

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 tag could have children like (one each) and could also have its inner, outer, an

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 Lane wrote: > > Andres Freund 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 Explain

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 9:32 PM, Tom Lane wrote: > Andres Freund 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 (). > > Yeah, I was just wondering what to do with t

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Andres Freund 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 (). Yeah, I was just wondering what to do with the code. I'm not sure if it's worth trying to fold i

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 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 an

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 8:53 PM, Tom Lane wrote: > Andres Freund 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 stru

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 9:03 PM, Tom Lane wrote: > Andrew Dunstan writes: >> I takle it back. It's still there at >> >> posted 3 days ago. > > Hmm, I think the archive website must be mangling that somehow. > What I have in the cod

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Andrew Dunstan writes: > I takle it back. It's still there at > > 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 == EXPLAIN_FORMAT_

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 8:48 PM, 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 and >>>

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 > >>> and > >>> I noti

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Andres Freund 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 this regard)

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 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
Andres Freund wrote: BTW, has anyone tried validating the XML at all? I just looked very briefly at the patch at and I noticed this which makes me suspicious: + if (es.format == EXPLAIN_FORMAT_XML) + append

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 > > i

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 be

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Robert Haas
On Sun, Aug 9, 2009 at 3:57 PM, Tom Lane wrote: > Robert Haas 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 asses

Re: [HACKERS] machine-readable explain output v4

2009-08-09 Thread Tom Lane
Robert Haas 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 CommitFest. I'm starting to

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Robert Haas
On Sun, Aug 2, 2009 at 7:29 PM, Andres Freund 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 require adding c

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Tom Lane
Robert Haas 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... regards, tom lan

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Robert Haas
On Wed, Aug 5, 2009 at 7:20 AM, Andrew Dunstan wrote: > Robert Haas wrote: >> On Sun, Aug 2, 2009 at 7:57 PM, Tom Lane wrote: >>> Robert Haas 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 >

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 Lane wrote: Robert Haas 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 Ex

Re: [HACKERS] machine-readable explain output v4

2009-08-05 Thread Robert Haas
On Sun, Aug 2, 2009 at 7:57 PM, Tom Lane wrote: > Robert Haas 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 ExplainResult

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Robert Haas
On Sun, Aug 2, 2009 at 7:57 PM, Tom Lane 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 they don't want.

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 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 examples shoul

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Tom Lane
Robert Haas 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 take an >>>

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 Freund 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 u

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Tom Lane
Robert Haas writes: > On Sun, Aug 2, 2009 at 12:06 PM, Andres Freund 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 know why this doesn't work, but

Re: [HACKERS] machine-readable explain output v4

2009-08-02 Thread Robert Haas
On Sun, Aug 2, 2009 at 12:06 PM, Andres Freund 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 to make t

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 v2

2009-07-31 Thread Robert Haas
On Fri, Jul 31, 2009 at 5:36 PM, Andres Freund wrote: > Hi Robert, > > On Friday 31 July 2009 23:13:54 Robert Haas wrote: >> On Sat, Jul 18, 2009 at 10:29 PM, Andres Freund 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

Re: [HACKERS] machine-readable explain output v2

2009-07-31 Thread Robert Haas
On Fri, Jul 31, 2009 at 6:04 PM, Andres Freund 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 annoyed by th

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 Freund 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

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 Freund 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 and/or tomorrow.

Re: [HACKERS] machine-readable explain output v2

2009-07-31 Thread Robert Haas
On Sat, Jul 18, 2009 at 10:29 PM, Andres Freund 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. Suggestions? > Anot

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-hacker

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 p

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 >>> EVERYTHI

Re: [HACKERS] machine-readable explain output

2009-06-17 Thread Robert Haas
On Wed, Jun 17, 2009 at 10:40 AM, Peter Eisentraut 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 with one

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,

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 expec

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 Robert Haas
On Wed, Jun 17, 2009 at 10:27 AM, 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 readabl

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 wrappin

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andres Freund
On 06/16/2009 09:51 PM, Robert Haas wrote: On Tue, Jun 16, 2009 at 2:12 PM, Tom Lane wrote: The main point here is that we have a pretty good idea of what general-purpose client code is likely to want to do with the data, and in a lot of cases that does not translate to having to know each node

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Robert Haas
On Tue, Jun 16, 2009 at 2:12 PM, Tom Lane wrote: > The main point here is that we have a pretty good idea of what > general-purpose client code is likely to want to do with the data, and > in a lot of cases that does not translate to having to know each node > type explicitly, so long as it can be

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Tom Lane
Robert Haas writes: > On Tue, Jun 16, 2009 at 1:21 PM, 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

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Robert Haas
On Tue, Jun 16, 2009 at 1:21 PM, Tom Lane wrote: > Robert Haas writes: >> On Tue, Jun 16, 2009 at 12:04 PM, Tom Lane wrote: >>> FWIW, I like Greg's idea of subdividing the available data this way. > >> I like it too, but I'd like to see us come up with a design that >> allows it to be used for all

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Tom Lane
Robert Haas writes: > On Tue, Jun 16, 2009 at 12:04 PM, Tom Lane wrote: >> FWIW, I like Greg's idea of subdividing the available data this way. > I like it too, but I'd like to see us come up with a design that > allows it to be used for all of the output formats (text, XML, and > JSON). I think

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Robert Haas
On Tue, Jun 16, 2009 at 12:04 PM, Tom Lane wrote: > Greg Stark writes: >> I'm picturing adding a new tag, such as , or actually I was >> thinking of . If we have separate tags for all the estimates >> and actual timings then any tags which come with the or >> option would just get mixed up with

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andrew Dunstan
Tom Lane wrote: But I'd be just as happy with a naming convention, like versus , etc. I don't know enough about XML usage to understand the benefits and costs of different ways of providing that kind of structure. FYI, you probably don't want this. the ':' is not just another character,

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Tom Lane
Greg Stark writes: > I'm picturing adding a new tag, such as , or actually I was > thinking of . If we have separate tags for all the estimates > and actual timings then any tags which come with the or > option would just get mixed up with the estimates and timing > info. FWIW, I like Greg's id

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Greg Stark
On Tue, Jun 16, 2009 at 1:53 PM, Andres Freund wrote: > While that also looks sensible the more structured variant makes it easier > to integrate additional stats which may not easily be pressed in the > 'attribute' format. As a fastly contrived example you could have io > statistics over time like

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andrew Dunstan
Andres Freund wrote: Anyway, I think what this discussion points out is that we actually need a formal XML Schema for this output. Agreed. If helpful I can create a schema for the current format. That will give us a useful starting point. cheers andrew -- Sent via pgsql-hackers mailing

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Andrew Dunstan
Tom Lane wrote: Andres Freund writes: On 06/16/2009 04:32 PM, Robert Haas wrote: Note that even in this case we DON'T rely on the ordering of the nodes. The inner nodes have child nodes which contain their relationship to the parent. Not in the case of Append nodes, bu

Re: [HACKERS] machine-readable explain output

2009-06-16 Thread Tom Lane
Andres Freund writes: > On 06/16/2009 04:32 PM, Robert Haas wrote: >> Note that even in this case we DON'T rely on the ordering of the >> nodes. The inner nodes have child nodes which contain their >> relationship to the parent. > Not in the case of Append nodes, but I fail to see a problem the

  1   2   >