Re: Runtime dependency from size of a bytea field

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Runtime dependency from size of a bytea field
Дата
Msg-id AANLkTinV4F7nQLiNDJ0GW8kEKhJAsS14PPDAPEbAe9EN@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Runtime dependency from size of a bytea field  ("Sander, Ingo (NSN - DE/Munich)" <ingo.sander@nsn.com>)
Ответы Re: Runtime dependency from size of a bytea field
Список pgsql-performance
On Thu, Oct 7, 2010 at 12:11 AM, Sander, Ingo (NSN - DE/Munich)
<ingo.sander@nsn.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);
}

В списке pgsql-performance по дате отправления:

Предыдущее
От: Ivan Voras
Дата:
Сообщение: Re: [HACKERS] MIT benchmarks pgsql multicore (up to 48)performance
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Runtime dependency from size of a bytea field