From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 596 invoked by alias); 24 May 2006 09:31:01 -0000 Received: (qmail 560 invoked by uid 22791); 24 May 2006 09:30:59 -0000 X-Spam-Status: No, hits=1.9 required=5.0 tests=BAYES_50,DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST X-Spam-Check-By: sourceware.org Received: from MTA068A.interbusiness.it (HELO MTA068A.interbusiness.it) (85.37.17.68) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 24 May 2006 09:30:56 +0000 Received: from host202-230.pool82186.interbusiness.it (HELO [192.168.200.22]) ([82.186.230.202]) by MTA068A.interbusiness.it with ESMTP; 24 May 2006 11:27:09 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AQAAAKzAc0QL Message-ID: <447427F7.8060005@inwind.it> Date: Wed, 24 May 2006 09:31:00 -0000 From: Renato Gini User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: it, en MIME-Version: 1.0 To: rhdb-explain@sources.redhat.com CC: Fernando Nasser , dbhole@redhat.com, Andrea Gerbo Subject: [Fwd: rhdb-explain-2.0 suggested modification] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact rhdb-explain-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rhdb-explain-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00000.txt.bz2 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 '{'/ // // .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");