Clustered Index Delete

  • Hi All,

    I have a table claimheader which has a primary key on ClaimID.

    Several other tables are linked to this table via foreign key relationship on ClaimID column

    When I am deleting values from this claimheader table, the query plan shows

    Clustered index delete on Claimheader as well as all other related tables.

    Is this actually an index rebuild or what exactly is this ?

    Need explanation in simple terms ?

  • It's the operator which does the actual delete of the rows from the table. Looks like you have a cascading foreign key, so when you delete from the parent table, the linked rows are deleted from the child tables as well.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Shouldn't there be an index rebuild as well ??

  • No. Why would there be?

    Would you really want an index rebuild that could take hours in the middle of a delete query's execution?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Yes that was a silly question.

    I was in confusion with NonClustered Indexes rebuild when clustered indexes are rebuild

  • Nonclustered indexes are not rebuilt when the clustered index is rebuild.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply