Re: [HACKERS] Profile of current backend

From: Michael Meskes <meskes(at)topsystem(dot)de>
To: scrappy(at)hub(dot)org (The Hermit Hacker)
Cc: pgsql-hackers(at)postgresql(dot)org (PostgreSQL Hacker)
Subject: Re: [HACKERS] Profile of current backend
Date: 1998-02-10 15:10:16
Message-ID: 199802101510.QAA20626@gauss.topsystem.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The Hermit Hacker writes:
> Just curious, but do you have -F set to disable fsync()? We
> really really should disable that by default :(

I tried with -F and it runs nicely. No difference to see between PostgreSQL
and Oracle. I just ran another test which includes table creation, inserts
and drop (source follows). Here's the result:

Oracle 7.3.3.4.0:
I needed 21 seconds and -345682 microseconds for this test

PostgreSQL without -F:
I needed 152 seconds and -623545 microseconds for this test

PostgreSQL with -F:
I needed 5 seconds and 84411 microseconds for this test

Whow!

Here's the source (yes, our precompiler can handle this kind of program
already :-)):

#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>

exec sql include sqlca;

#define SQLCODE sqlca.sqlcode

void
db_error (char *msg)
{
sqlca.sqlerrm.sqlerrmc[sqlca.sqlerrm.sqlerrml] = '\0';
printf ("%s: db error %s\n", msg, sqlca.sqlerrm.sqlerrmc);
exit (1);
}

int
main ()
{
exec sql begin declare section;
long i;
exec sql end declare section;
struct timeval tvs, tve;

gettimeofday(&tvs, NULL);

exec sql connect 'mm';
if (SQLCODE)
db_error ("connect");

exec sql create table perftest(number int4, ascii char16);
if (SQLCODE)
db_error ("create t");

exec sql create unique index number on perftest(number);
if (SQLCODE)
db_error ("create i");

for (i = 0;i < 1407; i++)
{
exec sql begin declare section;
char text[16];
exec sql end declare section;

sprintf(text, "%ld", i);
exec sql insert into perftest(number, ascii) values (:i, :text);
if (SQLCODE)
db_error ("insert");

exec sql commit;
if (SQLCODE)
db_error ("commit");
}

exec sql drop index number;
if (SQLCODE)
db_error ("drop i");

exec sql drop table perftest;
if (SQLCODE)
db_error ("drop t");

exec sql commit;
if (SQLCODE)
db_error ("commit");

gettimeofday(&tve, NULL);

printf("I needed %ld seconds and %ld microseconds for this test\n", tve.tv_sec - tvs.tv_sec, tve.tv_usec - tvs.tv_usec);

return (0);
}

Michael

--
Dr. Michael Meskes, Project-Manager | topsystem Systemhaus GmbH
meskes(at)topsystem(dot)de | Europark A2, Adenauerstr. 20
meskes(at)debian(dot)org | 52146 Wuerselen
Go SF49ers! Go Rhein Fire! | Tel: (+49) 2405/4670-44
Use Debian GNU/Linux! | Fax: (+49) 2405/4670-10

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-02-10 15:24:53 Re: [HACKERS] Profile of current backend
Previous Message Darren King 1998-02-10 14:33:47 Re: [HACKERS] AIX port s_lock.h __AIX --> _AIX