postgres 8 performance

From: Paramveer(dot)Singh(at)trilogy(dot)com
To: "pgSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: postgres 8 performance
Date: 2004-09-07 10:12:02
Message-ID: OFF7778EA0.BBBB4CF8-ONE5256F08.00340895@trilogy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all!
I am running postgres 8 beta1 and for some reason it is really slow in
execution. I am not able to figure out why.
On a fresh install of postgres, the following code executed through jdbc

********************
for (int i=0; i < 10000; i++) {
s.execute("insert into tab values (" + i + ",'" + i +
"')") ;
}
****************

This took like 700 secs to execute.
However, the weird part is that a stored proc doing the same thing via

******************************
create or replace function perftest() returns integer as '
declare
i integer := 0 ;
begin
for i in 0..10000 loop
execute ''insert into tab values ( '' || i || '' ,''''xxx''''
)'' ;
end loop ;
return 0;
end ;

does the same thing in less than a second.

*************************************

I can't figure out what the problem is.
The app using jdbc and the postmaster instance were running on the same
comp so I can't believe that communication would make that big a hit on
performance.

Is there something else that I am doing wrong?
Finally, where can I look up some useful performance tuning tips to get my
server to run faster anyway?

thanks a lot
paramveer singh

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pierre-Frédéric Caillaud 2004-09-07 10:22:39 Re: postgres 8 performance
Previous Message Rory Campbell-Lange 2004-09-07 10:02:27 Re: Passing RECORD variable from func1() to func2()