Re: DBI Prepared statement much slower than postgres command line execution.

[email protected] (Erik)
Newsgroups perl.dbi.users
Organization http://groups.google.com
Message-ID <9cca7509-5073-42a5-a4c4-c5d31420f7be@l14g2000yql.googlegroups.com>
On Aug 9, 4:14 pm, [email protected] ("Greg Sabino Mullane") wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
> > I'm writing a short script which, as part of its normal operation,
> > performs a SUM on values from a Postgresql database.  When running the
> > summation query from the command line interface of Postgresql, it
> > looks like this:
>
> > dev=> EXPLAIN ANALYZE SELECT SUM(bytes) AS bytes FROM
>
> A command-line explain won't run the same plan as a prepared
> statement. See:
>
> http://blog.endpoint.com/2008/12/why-is-my-function-slow.html
>
> Also try setting $dbh->{pg_server_prepare} = 0; and see
> if the time changes.
>
> - --
> Greg Sabino Mullane [email protected]


Setting that on the statement handle does, indeed, help.  Thanks for
the tip, and for the link which has been quite illuminating!

Erik
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.