Re: bytea performance issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: brian stone <skye0507(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bytea performance issue
Date: 2007-01-26 04:41:17
Message-ID: 16778.1169786477@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

brian stone <skye0507(at)yahoo(dot)com> writes:
> I have to store binary data in a table, ranging from 512K - 1M. I am getting very poor performance when inserting this data.
> create table my_stuff (data bytea);
> I then try to insert 10 1M blobs into this table using PQexecParams from C. It takes ~10 seconds to insert the 10 records.
> The test is being performed locally so this is not a network issue. If I change the data I send from the client to 1M worth of text, and change the 'my_stuff.data' to TEXT, the same test takes ~2 seconds. Has anyone else seen this performance issue with bytea?

How are you transmitting the data exactly? Have you tried using
oprofile or some such to identify the culprit?

It does sound like escaping could be the issue, except that if you're
sending binary parameters as your message suggests (but doesn't actually
say) then there shouldn't be any escape processing going on.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message brian stone 2007-01-26 04:57:12 Re: bytea performance issue
Previous Message Bruce Momjian 2007-01-26 04:39:00 Re: [GENERAL] Autovacuum Improvements