Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7 - Mailing list pgsql-performance

From Steinar H. Gunderson
Subject Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
Date
Msg-id 20070510133807.GA17492@uio.no
Whole thread Raw
In response to REVISIT specific query (not all) on Pg8 MUCH slower than Pg7  (Susan Russo <russo@morgan.harvard.edu>)
List 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/

pgsql-performance by date:

Previous
From: Susan Russo
Date:
Subject: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
Next
From: Bill Moran
Date:
Subject: Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7