Re: Delete based on rowid

From: Toon Koppelaars <toon.koppelaars_at_rulegen.com>
Date: Mon, 5 Oct 2009 12:40:49 +0200
Message-ID: <ecf3dae70910050340w124c262ekcdf1516dc62b5fb6_at_mail.gmail.com>



>
> Am asking this because in my case Oracle is doing a full index scan
>

Can you elaborate on that? Is the explain plan (or better tracefile) for that delete statement showing a full index scan?

I would expect the following to happen:
1) Oracle fetches the row directly using the rowid supplied in the delete statement.
Then,
2) Oracle reads all indexed column values of the fetched row, and uses these to delete the entries in the corresponding indexes. 3) Oracle deletes the row from the table.

On Mon, Oct 5, 2009 at 12:34 PM, DBA Deepak <oracle.tutorials_at_gmail.com>wrote:

> Have a simple question.
>
> When we delete a row based on rowid from an indexed table, how the index
> entry gets deleted?
>
> DELETE t WHERE rowid='<some rowid>';
>
> Am asking this because in my case Oracle is doing a full index scan. Can we
> say deleting an indexed table based on rowid may not be the fastest way of
> deleting a row?
>
> Please comment...
>

-- 
Toon Koppelaars
RuleGen BV
+31-615907269
Toon.Koppelaars_at_RuleGen.com
www.RuleGen.com
TheHelsinkiDeclaration.blogspot.com

(co)Author: "Applied Mathematics for Database Professionals"
www.RuleGen.com/pls/apex/f?p=14265:13

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Oct 05 2009 - 05:40:49 CDT

Original text of this message