pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: Susan Russo <russo@morgan.harvard.edu>
Cc: pgsql-performance@postgresql.org
Cc: harvsys@morgan.harvard.edu
Subject: Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
Date: Thu, 10 May 2007 15:38:07 +0200
Message-ID: <20070510133807.GA17492@uio.no> (raw)
In-Reply-To: <200705101323.l4ADN3Re016122@larrys.harvard.edu>
References: <200705101323.l4ADN3Re016122@larrys.harvard.edu>

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/



view thread (5+ messages)  latest in thread

Message-ID: <20070510133807.GA17492@uio.no>
Permalink:  ../20070510133807.GA17492@uio.no/
Also on:    postgresql.org/message-id/20070510133807.GA17492@uio.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sgunderson@bigfoot.com, russo@morgan.harvard.edu, harvsys@morgan.harvard.edu
  Subject: Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
  In-Reply-To: <20070510133807.GA17492@uio.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox