develooper Front page | perl.beginners | Postings from August 2009

Re: delete 20 000 records in oracle from perl

Thread Previous | Thread Next
Raymond Wan
August 16, 2009 23:39
Re: delete 20 000 records in oracle from perl
Message ID:

Hi Luke,

luke devon wrote:
> Thanks for the reply . Yes , when we going to delete those records , CPU is
> going high.So then its effecting to the performance. as i beginner in perl ,
> how can i implement multi-threaded env ? Can you help me further ?

Hmmmmm, well, I don't see any advantage of a multi-threaded version [perhaps 
someone else can see something I can't?].  Also, I have to admit that I don't 
know how to run Perl in a multi-threaded env.  [Sorry!]

But, before going down that path, how about creating multiple instances of Perl. 
  I would think doing this is much easier and give you the same benefits.  Have 
you considered this?

One reason for my skepticism is that your problem is in the SQL statement.  What 
Perl is doing is simply to act as a wrapper around it.  A multi-threaded Perl 
script needs to know how to partition the tables so that they don't step on each 
other's toes; but it's the SQL that needs to worry about it.  If there was a 
trivial way to separate the rows (i.e., "pkey = 1" for one set of rows and "pkey 
= 2" for another set), then you could run two instances of Perl to do this.

i.e., one does:  "delete rec1,rec2 " from tb1 where pkey = 1" and the other does 
the same but with "pkey = 2"...


PS:  Even live servers like Amazon have downtime.  Is it critical that you can't 
bring the server down once a day or week for 2 minutes?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About