Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7

From: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
To: Susan Russo <russo(at)morgan(dot)harvard(dot)edu>
Cc: pgsql-performance(at)postgresql(dot)org, harvsys(at)morgan(dot)harvard(dot)edu
Subject: Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
Date: 2007-05-10 13:38:07
Message-ID: 20070510133807.GA17492@uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Bill Moran 2007-05-10 13:47:02 Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
Previous Message Susan Russo 2007-05-10 13:23:03 REVISIT specific query (not all) on Pg8 MUCH slower than Pg7