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

Home -> Community -> Usenet -> c.d.o.misc -> Re: optimizing in delete-statement

Re: optimizing in delete-statement

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 7 Feb 2003 19:46:24 GMT
Message-ID: <b212eg$17tg0d$2@ID-82536.news.dfncis.de>

> Hi,
>
> following statement works very slow:
>
> DELETE FROM tRoute
> WHERE RouteId IN
> (
> SELECT ItemId
> FROM tUserXorganizer
> WHERE Type = :1 AND FKUserId = :2
> )
> ;
>
> It performs a full table scan on tRoute.
> IMHO that's why it has to search all RouteId's and then have a look at
> tUserXOrganizer to find them there.
> Is there a better way for deleting on this table without full table
> scan? This statement is used in a procedure.

Hello

Does tRoute have an index on RouteId?
Does tRoute have a primary key that is referenced by another table whose foreign key is not indexed?

Rene Nyffenegger

-- 
  no sig today
Received on Fri Feb 07 2003 - 13:46:24 CST

Original text of this message

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