x

Ghosts in the Machine

Today's SSC QOTD (SQL Server Central Question of the Day) was about Ghost records. A deleted record is not necessarily deleted (reminding me of FoxPro by the way).

So, how does the SQL engine mark records for deletion?

more ▼

asked Jun 02, 2011 at 11:02 AM in Default

avatar image

Mark
2.6k 24 27 31

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

It isn't any Black Magic... the Row Header on the data page has a bit to indicate that the row is marked for deletion. A background process cleans up these deleted rows as resources permit.

If a rollback happens the row isn't "restored", the bit is just flipped again and - voila - the row is undeleted .

more ▼

answered Jun 02, 2011 at 01:28 PM

avatar image

Blackhawk-17
12k 30 35 42

That's right, it's only magic when you don't understand it. Thank's for the explanation Blackhawk.

Jun 02, 2011 at 01:35 PM Mark
(comments are locked)
10|1200 characters needed characters left

Looks like you are venturing into Paul Randal territory. He has a couple of very good posts:

more ▼

answered Jun 02, 2011 at 11:37 AM

avatar image

Oleg
16.8k 3 7 28

Thanks Oleg. Yes, I'll be looking forward to Gail's post too, that out to be a good read.

Jun 02, 2011 at 01:03 PM Mark
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x58

asked: Jun 02, 2011 at 11:02 AM

Seen: 1103 times

Last Updated: Jun 02, 2011 at 11:02 AM

Copyright 2016 Redgate Software. Privacy Policy