* [Fwd: rhdb-explain-2.0 suggested modification]
@ 2006-05-24 9:31 Renato Gini
0 siblings, 0 replies; only message in thread
From: Renato Gini @ 2006-05-24 9:31 UTC (permalink / raw)
To: rhdb-explain; +Cc: Fernando Nasser, dbhole, Andrea Gerbo
Hi,
as suggested by Fernando Nasser, we repost our message to this e-mail
address.
We also added the version of PostgreSql we used (previously forgotten);
we will be glad to test your new version for PostgreSql v.8 when available!
Best regards
Renato Gini & Andrea Gerbo
Hello,
we are two italian developers; your tool is really great!!!
While trying to use it, we found a great loss of performances when the query has more than 1 or 2 components;
the memory was used at full and the execution time raised till we where forced to stop it by killing the process.
We made the attached modification to the source ExplainParserV73.java (using StringBuffer instead of String object) and the response is now a few seconds independently from the query complexity.
We are using Java 1.4.2_06 on a Linux (debian based) machine with PostgreSql vers.7.4
We hope our suggestion can be useful and we are available for any further question or specification.
Many thanks to you for your great work.
Renato Gini mailto:rgini@inwind.it
Andrea Gerbo mailto:andrea.gerbo@poste.it
Attachment: source modification
//ADDED
StringBuffer tmp = new StringBuffer();
// Parse the first row. Ignore all 'bad' rows.
while (rs.next())
{
// Parse the first part (the dump)
// The form of the dump is:
// .A '{'/
// <dump - may contain pairs of '{}'>
// .A '}'
// first row
str = rs.getString(1);
if (str.trim().startsWith("{"))
{
///REPLACED dump = str;/
tmp.append(str);
break;
}
else
{
System.err.println("Ignoring: " + str);
rs.next();
}
}
if (rs.isAfterLast())
throw new ExplainException("Unexpected EXPLAIN output");
// If we get here, we know that first row has the first "{"
// look for the "}" that closes the query dump
int braces = countChars(str, '{');
braces -= countChars(str, '}');
int ii=0;
while ((braces > 0) && (rs.next()))
{
str = rs.getString(1);
//REPLACED dump += "\n" + str;
tmp.append ("\n" + str);
braces += countChars(str, '{');
braces -= countChars(str, '}');
}
//ADDED
dump = tmp.toString();
if (rs.isAfterLast())
throw new ExplainException("Got nothing when QUERY PLAN expected");
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-24 9:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-24 9:31 [Fwd: rhdb-explain-2.0 suggested modification] Renato Gini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).