pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vlad <marchenko@gmail.com>
To: Brandon Metcalf <bmetcalf@nortel.com>
Cc: dbdpg-general@gborg.postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [Dbdpg-general] benchmarking old Pg and DBD::Pg
Date: Fri, 8 Apr 2005 14:12:31 -0400
Message-ID: <cd70c6810504081112694ba268@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.58L.0504081127400.18466@cash.rhiamet.com>
References: <Pine.LNX.4.58L.0504081127400.18466@cash.rhiamet.com>

Hi there,

we've noticed that too here and quick explanation is - with the new
"prepare" implementation, the query get prepared on the server side,
which is good; the problem is that all of the bind values passed to
the sql server during execute call are in form of ***varchar***, i.e.
even if a field is of int type in postgresql table, DBD::Pg passes
your bind value as char - as a result, postgresql doesn't use indexes.

I don't know if developers of new DBD::Pg have some game plan to fix
this problem... but it won't be easy: since perl is a no-var-type
language, so either DBD::Pg needs to analyze the table columns data
types first before executing a query and then use correct type for
bind values, or let coder pass those types explicitly... though I'm
not aware of a method in DBI that would let them do that...

Anyone from DBD::Pg can comment this please?

I was going to post an example to the list later today.

On Apr 8, 2005 12:30 PM, Brandon Metcalf <bmetcalf@nortel.com> wrote:
> Has anyone done any benchmarking between the old Pg interface and
> DBI/DBD::Pg?  I have two versions of some code one of which uses Pg
> and the other DBI/DBD::Pg and the latter appears to cause much more of
> load on the system where it's running than the former.  However, I
> haven't done any benchmarking to support this claim.
> 
> --
> Brandon
> _______________________________________________
> Dbdpg-general mailing list
> Dbdpg-general@gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/dbdpg-general
> 


-- 

Vlad



view thread (18+ messages)  latest in thread

Message-ID: <cd70c6810504081112694ba268@mail.gmail.com>
Permalink:  ../cd70c6810504081112694ba268@mail.gmail.com/
Also on:    postgresql.org/message-id/cd70c6810504081112694ba268@mail.gmail.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: marchenko@gmail.com, bmetcalf@nortel.com, dbdpg-general@gborg.postgresql.org
  Subject: Re: [Dbdpg-general] benchmarking old Pg and DBD::Pg
  In-Reply-To: <cd70c6810504081112694ba268@mail.gmail.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