Re: performance tuning in large function / transaction

MindTerm <mindterm@yahoo.com>

From: MindTerm <mindterm@yahoo.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Date: 2001-12-14T08:05:49Z
Lists: pgsql-sql
Hi all,

  senario:
  
  cursor 1 loop ( e.g. find student id )
   cursor 2 loop ( e.g. find courses of this student )
    cursor 3 loop ( e.g. update course information )
      delele course detail ...
      or
      delete course detail ... ( same primary key ) 
      insert course detail ... ( same primary key )
    end loop 3
   end loop 2
  end loop 1

  It did 75 delete actions 140 update actions ( delete
and insert ). The process time was about 5-6 minutes
while oracle was 10 seconds to 20 seconds . 

postgresql.conf : 
=================
shared_buffers = 3200
wal_buffers = 80


running on linux 7.1 , 512M ram. 

M.T.




--- Stephan Szabo <sszabo@megazone23.bigpanda.com>
wrote:
> On Thu, 13 Dec 2001, MindTerm wrote:
> 
> > Hi all,
> >
> >   I will try to assign more memory to shared
> memory,
> > say 50M ~ 100M .
> >
> >   I am runing something like that ..
> >
> >   cursor loop 1
> >    cursor loop 2
> >     cursor loop 3
> >      tmp = primary key
> >      delete tmp ....
> >      insert tmp ....
> >     end loop 3
> >    end loop 2
> >   end loop 3
> >
> > will delete and insert record with same primary
> key
> > within a transaction reduce the performance ?
> 
> Hmm, that might, is the tmp different for each
> combination of 1,2 and 3?  I'm not really sure.
> You might also want to watch the backend's memory
> usage during the call to see how big it gets just
> to make sure there's not something bad happening.
> 
> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com