Re: Delete based on rowid

  • From: Toon Koppelaars <toon.koppelaars@xxxxxxxxxxx>
  • To: oracle.tutorials@xxxxxxxxx
  • Date: Mon, 5 Oct 2009 12:40:49 +0200

>
> 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@xxxxxxxxx>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@xxxxxxxxxxx
www.RuleGen.com
TheHelsinkiDeclaration.blogspot.com

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

Other related posts: