Re: Perl/DBI vs Native - Mailing list pgsql-performance

From Tom Lane
Subject Re: Perl/DBI vs Native
Date
Msg-id 16163.1216665872@sss.pgh.pa.us
Whole thread Raw
In response to Re: Perl/DBI vs Native  (Craig James <craig_james@emolecules.com>)
Responses Re: Perl/DBI vs Native  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Greg Smith
Date:
Subject: Re: Performance on Sun Fire X4150 x64 (dd, bonnie++, pgbench)
Next
From: Berge Schwebs Bjørlo
Date:
Subject: Re: [BACKUPS]Little backups