Re: Using libpq, floats and binary data

From: Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Michael Hull <mikehulluk(at)googlemail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Using libpq, floats and binary data
Date: 2010-09-15 22:52:18
Message-ID: AANLkTi=47CyLTkRPKWMJXHda=bSskd2xYRFxAKjo9TOS@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 16, 2010 at 12:37 AM, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:

> On Wed, Sep 15, 2010 at 6:18 PM, Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>
> wrote:
> > Hi,
> > Inserting many of rows is almost always IO bound. Converting ints and
> floats
> > to text is CPU bound and really fast anyway. To speed things up first
> look
> > at things like indexes, how often you need to COMMIT or using COPY. Only
> > then look at prepared statements and binary transfer modes. Else it's
> simply
> > not worth the headache.
>
> That's an awfully broad statement, and untrue...many applications are
> cpu bound. It's easier to scale storage than cpu after a point. Also,
> solid state storage is going to become increasingly common moving
> forwards.
>
> Not all type receiving parsing is trivial as you claim; timestamps and
> bytea for example are significantly cheaper to send in binary wire
> format. Anyways, libpqtypes gives you all the advantages without all
> the fuss. If you are really looking to shave cycles we allow you to
> prepare the format string as well as prepare the statement before
> sending it. We wrote this interface for a reason: I'd say on average
> it cuts down query time around 20% on average in addition to the other
> advantages it provides.
>
> merlin
>

I think we can agree on one thing: trying to do it without libpqtypes is a
bad idea.

Groeten, Arjen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scot Kreienkamp 2010-09-15 23:18:34 Re: help with error "unexpected pageaddr"
Previous Message Merlin Moncure 2010-09-15 22:37:20 Re: Using libpq, floats and binary data