Re: EXPLAIN BUFFERS - Mailing list pgsql-hackers

From Greg Smith
Subject Re: EXPLAIN BUFFERS
Date
Msg-id 4B1DD16E.1030406@2ndquadrant.com
Whole thread Raw
In response to Re: EXPLAIN BUFFERS  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: EXPLAIN BUFFERS  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas wrote: <blockquote cite="mid:603c8f070912071905g1a69437ch6e85282d6016ed11@mail.gmail.com" type="cite"><pre
wrap="">OnMon, Dec 7, 2009 at 9:58 PM, Itagaki Takahiro
 
<a class="moz-txt-link-rfc2396E"
href="mailto:itagaki.takahiro@oss.ntt.co.jp"><itagaki.takahiro@oss.ntt.co.jp></a>wrote: </pre><blockquote
type="cite"><prewrap="">
 
Obviously I should not hide any information only in the text format.
The new output will be: (in one line)
 Shared Blocks: (hit=2 read=1641 written=0) Local Blocks: (hit=0 read=0 written=0) Temp Blocks: (read=1443
written=1443)  </pre></blockquote><pre wrap="">
 
Hmm, that's a little awkward.  I think we could drop some of the punctuation.

Shared Blocks: hit 2 read 1641 wrote 0, Local Blocks: hit 0 read 0
wrote 0, Temp Blocks: read 1443 wrote 1443 </pre></blockquote> Having written more things to parse log files that
shouldhave been saved in a better format after the fact than I'd like, I'd say that replacing the "=" signs used as a
delimiterwith a space is a step backwards.  That doesn't save any space anyway, and drifts too far from what one gets
outof regular EXPLAIN I think.<br /><br /> I was perfectly happy with proposed text format as being a reasonable
trade-offbetween *possible* to parse if all you have is the text format, while still being readable.  If you want to
compresshorizontally, get rid of "Blocks" after the first usage is the first thing to do:<br /><br /> (1) Blocks
Shared:(hit=2 read=1641 written=0) Local: (hit=0 read=0 written=0) Temp: (read=1443 written=1443)<br /><pre
wrap=""></pre>That's already at about the same length as what you suggested at 105 characters, without losing any
usefulformatting.  <br /><br /> If further compression is required, you could just remove all the parentheses:<br /><br
/>(2) Blocks Shared:hit=2 read=1641 written=0 Local:hit=0 read=0 written=0 Temp:read=1443 written=1443<br /><br /> I
don'treally like this though.  Instead you could abbreviate the rest of the repeated text and reduce the number of
spaces:<br/><br /> (3) Blocks Shared:(hit=2 read=1641 written=0) Local:(h=0 r=0 w=0) Temp:(r=1443 w=1443)<br /><pre
wrap=""></pre>And now we're at the smallest result yet without any real loss in readability--I'd argue it's faster to
readin fact.  This has a good balance of fitting on a reasonably wide console (the above is down to 82 characters),
stillbeing readable to anyone, and being possible to machine parse in a pinch if all you have are text logs around
(spliton : then =).  It might be too compressed down for some tastes though.<br /><br /><pre class="moz-signature"
cols="72">--
 
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
<a class="moz-txt-link-abbreviated" href="mailto:greg@2ndQuadrant.com">greg@2ndQuadrant.com</a>  <a
class="moz-txt-link-abbreviated"href="http://www.2ndQuadrant.com">www.2ndQuadrant.com</a>
 
</pre>

pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: A sniffer for the buffer
Next
From: Robert Haas
Date:
Subject: Re: EXPLAIN BUFFERS