pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <greg@turnstep.com>
To: pgsql-interfaces@postgresql.org
Cc: gsstark@mit.edu
Subject: Re: DBD::Pg performance bites compared to DBD::mysql?
Date: Wed, 15 Jun 2005 02:17:44 -0000
Message-ID: <8b2e8b9f285b6431df744927947cdfd9@biglumber.com> (raw)
In-Reply-To: <87u0k11lpv.fsf@stark.xeocode.com>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I wonder if Postgres is being bitten by doing lots of extra round trips. Maybe
> the MySQL driver detects when there are no placeholders and no parameters and
> uses a different protocol method that only requires a single round trip?

We're not making any extra round trips per se, but we are not taking advantage of
the fact that we can know up front that the statement will not take any
parameters, and we can avoid parsing it for placeholders. My current idea is to treat
do(statement,args) as it currently is (sent to prepare/execute using PQexec (<7.4) or
PQexecParams (newer servers)), but to make a special fast path for simple do(statement)
that basically just throws the whole thing in a quick PQexec and returns. We've been
doing a lot of rewriting of stuff to support the new 7.4/8.0 v3 protocol stuff
such as PQprepare: now we can start the optimizing. :)

> Or given your example maybe it even notices no result is needed and doesn't even
> wait for a response?

That would be a neat trick, but they are not doing that. I don't even think it's
currently possible to derive that information via DBI the way things are now. Would
make a nice long-term micro-optimization though. :)

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200506142215
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFCr4+uvJuQZxSWSsgRApw5AJ9g3tQfihVWj6yOV0sHp5/Md15r4QCgps0Y
f1j8nPU6EqioSh20tckBsE0=
=X4WB
-----END PGP SIGNATURE-----





view thread (9+ messages)  latest in thread

Message-ID: <8b2e8b9f285b6431df744927947cdfd9@biglumber.com>
Permalink:  ../8b2e8b9f285b6431df744927947cdfd9@biglumber.com/
Also on:    postgresql.org/message-id/8b2e8b9f285b6431df744927947cdfd9@biglumber.com

 · 

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-interfaces@postgresql.org
  Cc: greg@turnstep.com, gsstark@mit.edu
  Subject: Re: DBD::Pg performance bites compared to DBD::mysql?
  In-Reply-To: <8b2e8b9f285b6431df744927947cdfd9@biglumber.com>

* 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