Re: machine-readable explain output v4
От | Andrew Dunstan |
---|---|
Тема | Re: machine-readable explain output v4 |
Дата | |
Msg-id | 4A82E8BD.4050706@dunslane.net обсуждение исходный текст |
Ответ на | Re: machine-readable explain output v4 (Csaba Nagy <nagy@ecircle-ag.com>) |
Ответы |
Re: machine-readable explain output v4
|
Список | pgsql-hackers |
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 it's one line and rely on that. That's part of > being machine readable, being able to rely on getting it at all without > too much parsing magic... > > > 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 it's necessary. The extraction tools will be simple whether or not we put everything on one line. Assuming we adopt Alvaro's suggestion of an <auto-explain> root, here's how it would work without putting everything on one line: { echo "<explain-root>"; sed -n '!<auto-explain>!,!</auto-explain>!p' logfile ; echo "</explain-root>"; } > explain-plans.xml Putting everything on one line, this becomes: { echo "<explain-root>"; sed -n '!<auto-explain>!p' logfile ; echo "</explain-root>"; } > explain-plans.xml Not very hard either way, is it? cheers andrew
В списке pgsql-hackers по дате отправления: