Re: Runtime dependency from size of a bytea field

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: "Sander, Ingo (NSN - DE/Munich)" <ingo(dot)sander(at)nsn(dot)com>
Cc: ext Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Runtime dependency from size of a bytea field
Date: 2010-10-07 14:49:27
Message-ID: AANLkTinV4F7nQLiNDJ0GW8kEKhJAsS14PPDAPEbAe9EN@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Oct 7, 2010 at 12:11 AM, Sander, Ingo (NSN - DE/Munich)
<ingo(dot)sander(at)nsn(dot)com> wrote:
> As written before I have rerun the test a) without compression and b)
> with enlarged BLOCK_SIZE. Result was the same.

Using libpqtypes (source code follows after sig), stock postgres,
stock table, I was not able to confirm your results. 4000 bytea
blocks, loops of 1000 I was able to send in about 600ms. 50000 byte
blocks I was able to send in around 2 seconds on workstation class
hardware -- maybe something else is going on?.

merlin

#include "libpq-fe.h"
#include "libpqtypes.h"

#define DATASZ 50000

int main()
{
int i;
PGbytea b;
char data[DATASZ];
PGconn *c = PQconnectdb("host=localhost dbname=postgres");
if(PQstatus(c) != CONNECTION_OK)
{
printf("bad connection");
return -1;
}

PQtypesRegister(c);

b.data = data;
b.len = DATASZ;

for(i=0; i<1000; i++)
{
PGresult *res = PQexecf(c, "insert into bytea_demo(index, part1)
values (%int4, %bytea)", i, &b);

if(!res)
{
printf("got %s\n", PQgeterror());
return -1;
}
PQclear(res);
}

PQfinish(c);
}

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephen Frost 2010-10-07 14:52:19 Re: On Scalability
Previous Message Vincenzo Romano 2010-10-07 14:44:34 Re: On Scalability