Explain Output made Colorful

Explain Output made Colorful

Post by Adrian 'Dagurashibanipal' von Bidd » Wed, 21 Aug 2002 17:09:14

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

> I have a hard time looking at explain output, so I cobbled together this =

script to generate HTML with certain things highlighted in colors of your c=
hoosing.  Please note that I know as much shelll scripting as I do Swahili.

Cool idea. thanks.

Note on the color scheme. People often think red=3Dbad, green=3Dgood.
Perhaps a more neutral coloring would be appropriate - seqscan is not
bad, pg choses seqscan because it thinks it would be faster, after all.
(If there is an index available, of course).

-- vbi

secure email with gpg                         http://fortytwo.ch/gpg

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.0.7 (GNU/Linux)




1. Explain Output made Colourful

I apologise if this is a duplicate, my MTA is really acting up and I haven't
seen it on the list. Incase it was the size of the attachments they're now
located here ( http://lucentstudios.com/pg/ ).


Ian Harding wrote on August 19, 2002:

I did a quick rewrite, but then fell prey to feature creep ;). So it's now
in Perl and produces HTML tables. It takes EXPLAIN output on STDIN and is
configured through a stylesheet.

        pgsql -U user -D database -c "EXPLAIN query" 2>&1 |
        ./explain > out.html

Or just call it with a text file:

        perl explain in.txt out.html

The sample is a bit doctored as I embedded the stylesheet in it so people
could preview from email if they wanted. Output HTMLs require the CSS
(Cascading Style Sheet) to be in the same dir as them by default.

It doesn't use any modules (which means it's icky embedded HTML ;) so it
should work on any *nix system by default. Pretty rough but should work.

Have fun.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly

2. Optional fature not implemented

3. Making sense of an explain

4. Debugging Stored Procedures.

5. Bad side-effect from making EXPLAIN return a select result

6. RAM Problem

7. Labeling join rule in EXPLAIN output

8. Security ASP-MSDE


10. output from EXPLAIN VERBOSE

11. SET EXPLAIN output

12. Adding qualification conditions to EXPLAIN output

13. Analyzing EXPLAIN output