pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig James <craig_james@emolecules.com>
Cc: valiouk@yahoo.co.uk, psql performance <pgsql-performance@postgresql.org>
Subject: Re: Perl/DBI vs Native
Date: Mon, 21 Jul 2008 14:44:32 -0400
Message-ID: <16163.1216665872@sss.pgh.pa.us> (raw)
In-Reply-To: <4884C633.5050506@emolecules.com>
References: <768129.60859.qm@web25802.mail.ukl.yahoo.com>
	<4884C633.5050506@emolecules.com>

Craig James <craig_james@emolecules.com> writes:
> Valentin Bogdanov wrote: 
>> I have ran quite a few tests comparing how long a query takes to
>> execute from Perl/DBI as compared to psql/pqlib. No matter how many
>> times I run the test the results were always the same.
>> 
>> I run a SELECT all on a fairly big table and enabled the
>> log_min_duration_statement option. With psql postgres consistently
>> logs half a second while the exact same query executed with Perl/DBI
>> takes again consistently 2 seconds.

> The problem may be that your two tests are not equivalent.  When Perl
> executes a statement, it copies the *entire* result set back to the
> client before it returns the first row.

Sure, but so does psql (unless you've turned on the magic FETCH_COUNT
setting).  I think the theories about prepared versus literal statements
were more promising; but I don't know DBI well enough to know exactly
what it was sending to the server.

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <16163.1216665872@sss.pgh.pa.us>
Permalink:  ../16163.1216665872@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16163.1216665872@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, craig_james@emolecules.com
  Subject: Re: Perl/DBI vs Native
  In-Reply-To: <16163.1216665872@sss.pgh.pa.us>

* 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