Skip site navigation (1) Skip section navigation (2)

Re: INSERT times - same storage space but more fields ->much slower inserts

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Matthew Wakeling <matthew(at)flymine(dot)org>,"pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: INSERT times - same storage space but more fields ->much slower inserts
Date: 2009-04-15 00:54:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance

* Craig Ringer (craig(at)postnewspapers(dot)com(dot)au) wrote:
> In other cases, binary-format COPY would be unsafe without some way to
> determine remote endianness and sizeof(various types).

As Tom mentioned already, the binary protocol is actually pretty well
defined, and it's in network-byte-order, aka, big-endian.  The only
issue that I can think of off-hand that you need to know about the
server is if it's using 64-bit integers for date-times or if it's using
float.  That's a simple check to do, however, specifically with:

show integer_datetimes;

It's also alot cheaper to do the necessary byte-flipping to go from
whatever-endian to network-byte-order than to do the whole printf/atoi
conversion.  Handling timestamps takes a bit more magic but you can just
pull the appropriate code/#defines from the server backend, but I don't
think that's even an issue for this particular set.

What does your test harness currently look like, and what would you like
to see to test the binary-format COPY?  I'd be happy to write up the
code necessary to implement binary-format COPY for this.



In response to


pgsql-performance by date

Next:From: PeeyushDate: 2009-04-15 10:57:50
Subject: need information
Previous:From: Brian CoxDate: 2009-04-15 00:41:24
Subject: error updating a very large table

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group