Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: slow delete sql

Re: slow delete sql

From: arjan <adalebout_at_hutchison.com.au>
Date: 6 Apr 2004 20:22:26 -0700
Message-ID: <55cbd77.0404061922.1603ef1d@posting.google.com>


I think analyzing the table will only update the stats. It's looking at the latest stats.

"Alistair Thomson" <alistair_at_despammed.com> wrote in message news:<4072aed5$0$95327$65c69314_at_mercury.nildram.net>...
> Hi
>
> not sure if it will help but try and analyze the table.
>
> Alistair
>
> "arjan" <adalebout_at_hutchison.com.au> wrote in message
> news:55cbd77.0404060436.6d1c7f34_at_posting.google.com...
> > Hi there,
> >
> > I have a delete sql that runs too slow (around 15 mins). I would like
> > to improve it.
> >
> > It looks like this:
> >
> > delete from table_a a
> > where exists (select *
> > from table_b b
> > where b.columnX = a.columnX
> > and b.columnY = a.columnY)
> >
> > There are two indexes. IndexA on table_a(columnX,columnY) and IndexB
> > on table_b(columnX,columnY).
> >
> > Looking at the statement in explain plan, it shows that it's doing
> > full scans on both tables. It's not picking up an index hint like
> > this:
> >
> > delete /*+ INDEX(a IndexA) */ from table_a a
> > where exists (select *
> > from table_b b
> > where b.columnX = a.columnX
> > and b.columnY = a.columnY)
> >
> > any suggestions?
> >
> > Thanks
Received on Tue Apr 06 2004 - 22:22:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US