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

Поиск
Список
Период
Сортировка
От Steinar H. Gunderson
Тема Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
Дата
Msg-id 20070510133807.GA17492@uio.no
обсуждение исходный текст
Ответ на REVISIT specific query (not all) on Pg8 MUCH slower than Pg7  (Susan Russo <russo@morgan.harvard.edu>)
Список 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 по дате отправления:

Предыдущее
От: Susan Russo
Дата:
Сообщение: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7
Следующее
От: Bill Moran
Дата:
Сообщение: Re: REVISIT specific query (not all) on Pg8 MUCH slower than Pg7