Re: [GENERAL] Using libpq, floats and binary data

2010-09-16 Thread Merlin Moncure
On Wed, Sep 15, 2010 at 6:52 PM, Arjen Nienhuis a.g.nienh...@gmail.com wrote: On Thu, Sep 16, 2010 at 12:37 AM, Merlin Moncure mmonc...@gmail.com wrote: On Wed, Sep 15, 2010 at 6:18 PM, Arjen Nienhuis a.g.nienh...@gmail.com wrote: Hi, Inserting many of rows is almost always IO bound.

[GENERAL] Using libpq, floats and binary data

2010-09-15 Thread Michael Hull
Hi Guys, I have jsut started to use the libpq interface to postgre, and was wondering if someone with some experience could explain the 'best practices' :) I am preparing a query, then submitting it with binary data. 6 values are ints, and one is a float. For the ints, I understand that since I

Re: [GENERAL] Using libpq, floats and binary data

2010-09-15 Thread Merlin Moncure
zz On Wed, Sep 15, 2010 at 12:02 PM, Michael Hull mikehul...@googlemail.com wrote: Hi Guys, I have jsut started to use the libpq interface to postgre, and was wondering if someone with some experience could explain the 'best practices' :) I am preparing a query, then submitting it with

Re: [GENERAL] Using libpq, floats and binary data

2010-09-15 Thread Arjen Nienhuis
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

Re: [GENERAL] Using libpq, floats and binary data

2010-09-15 Thread Merlin Moncure
On Wed, Sep 15, 2010 at 6:18 PM, Arjen Nienhuis a.g.nienh...@gmail.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

Re: [GENERAL] Using libpq, floats and binary data

2010-09-15 Thread Arjen Nienhuis
On Thu, Sep 16, 2010 at 12:37 AM, Merlin Moncure mmonc...@gmail.com wrote: On Wed, Sep 15, 2010 at 6:18 PM, Arjen Nienhuis a.g.nienh...@gmail.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