Search Postgresql Archives

Re: PQgetlength vs. octet_length()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 18, 2009 at 6:39 PM, Michael Clark<codingninja@xxxxxxxxx> wrote:
> But it seems pretty crazy that a 140meg bit of data goes to 1.3 gigs.  Does
> that seem a bit excessive?

>From what you posted earlier it looked like it was turning into about
500M which sounds about right. Presumably either libpq or your code is
holding two copies of it in ram at some point in the process.

8.5 will have an option to use a denser hex encoding but it will still
be 2x as large as the raw data.

> I avoided the binary mode because that seemed to be rather confusing when
> having to deal with non-bytea data types.  The docs make it sound like
> binary mode should be avoided because what you get back for a datetime
> varies per platform.

There are definitely disadvantages. Generally it requires you to know
what the binary representation of your data types is and they're not
all well documented or guaranteed not to change in the future. I
wouldn't recommend someone try to decode a numeric or a postgres array
for example. And floating point numbers are platform dependent.  But
bytea is a case where it seems more natural to use binary than text
representation.

-- 
greg
http://mit.edu/~gsstark/resume.pdf

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux