Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 983FB9FB43B for ; Thu, 10 May 2007 10:38:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 00370-08 for ; Thu, 10 May 2007 10:38:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id 279BC9FB446 for ; Thu, 10 May 2007 10:38:09 -0300 (ADT) Received: from trofast.ipv6.sesse.net ([2001:700:300:1803:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1Hm8qM-0001PM-Cf; Thu, 10 May 2007 15:38:06 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1Hm8qN-0004Z1-00; Thu, 10 May 2007 15:38:07 +0200 Date: Thu, 10 May 2007 15:38:07 +0200 From: "Steinar H. Gunderson" To: Susan Russo Cc: pgsql-performance@postgresql.org, harvsys@morgan.harvard.edu Subject: Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7 Message-ID: <20070510133807.GA17492@uio.no> Mail-Followup-To: Susan Russo , pgsql-performance@postgresql.org, harvsys@morgan.harvard.edu References: <200705101323.l4ADN3Re016122@larrys.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <200705101323.l4ADN3Re016122@larrys.harvard.edu> X-Operating-System: Linux 2.6.20.4 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/224 X-Sequence-Number: 24614 On Thu, May 10, 2007 at 09:23:03AM -0400, Susan Russo wrote: > my $aq = $dbh->prepare(sprintf("SELECT * from dbxref dx, db where accession = '%s' and dx.db_id = db.db_id and db.name = 'GB_protein'",$rec)); This is not related to your performance issues, but it usually considered bad form to use sprintf like this (mainly for security reasons). The usual way of doing this would be: my $aq = $dbh->prepare("SELECT * from dbxref dx, db where accession = ? and dx.db_id = db.db_id and db.name = 'GB_protein'"); $aq->execute($rec); /* Steinar */ -- Homepage: http://www.sesse.net/