Re: Deletes in Oracle 7

From: varad acharya <vacharya.ford_at_e-mail.com>
Date: 1996/10/07
Message-ID: <3258EE21.7AF6_at_e-mail.com>#1/1


Michael Ho wrote:
>
> Gary Mazzone wrote:
> > I am trying to delete about 65000 records from a database running on
> > SCO UNix Oracle 7.1. The deletes will go but I have to keep the number
> > of records below 20,000 and 14,000 records take about 2:30 hrs. The
> > table has a primary key on two fields, badge and bdate_time. I am doing
> > the delete wilth the following statement.
> >
> > delete from mgevents where bdate_time < '1-jan-96'
> >
> > this is the 65,000 record set. any help is greatly appricated. Please
> > replay to mazzogp_at_naesco.com
>

How many rows does this table have ?

Depending on the answer to the the above question you could extract those rows that you want to keep to a temporary table,truncate the original table and then reload the original table from the temporary table.

Another thing I've noticed is that your SQL will not use the index that exists on the table as you do not specify the leading part of the key that comprises your index in the WHERE clause. But then again you may be better off without using the index if your delete is going to end up deleting most of the rows.

-- 

Regards,

Varad Acharya
Received on Mon Oct 07 1996 - 00:00:00 CEST

Original text of this message