Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7988135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:20:56+00:00 2026-06-04T12:20:56+00:00

I have a SQL Server 2008 database with SET ALLOW_SNAPSHOT_ISOLATION ON and a Person

  • 0

I have a SQL Server 2008 database with SET ALLOW_SNAPSHOT_ISOLATION ON and a Person table with columns ID (primary key), and SSN (unique non-clustered index).

One of the rows in the database is ID = 1, SSN = 776-56-4453.

One one connection, this happens:

set transaction isolation level snapshot
begin transaction snapshot
while (1 = 1) select * from person where SSN = '777-77-7777'

Then on another connection:

update person set SSN = '555-55-5555' where ID = 1

As expected, the first connection continues to show the SSN as ‘777-77-7777’ even after the second connection finishes execution. The execution plan for the first connection shows a ‘clustered index seek’ on SSN, but how can the first connection continue to use the index, if the index key has been updated on the other connection?

Does SQL server do anything special to keep multiple versions of the indexes to accommodate for this?

I am trying to understand the performance characteristics of Snapshot Isolation level, and so want to confirm that SQL Server is smart enough to use existing indexes even when retrieving stale data from the row’s previous versions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:20:58+00:00Added an answer on June 4, 2026 at 12:20 pm

    As far as I can tell (using DBCC IND and DBCC PAGE as described here and looking at sys.dm_tran_version_store) when updating the index key in a database with snapshot isolation enabled the following happens.

    1. The original row is copied into the version store.
    2. The original row is marked as a ghost and gets the Version Pointer updated to point to the correct location.
    3. A new row is inserted for the new key value.
    4. At some later point the ghost clean up process runs and removes the row.

    The only difference in your scenario seems to be that the ghost cleanup process does not clean up the row until it is no longer required by an outstanding snapshot isolation transaction. i.e. the BTree contains rows for both the old and new key values until they are no longer required which allows an index seek on the old value to still work as before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2008 database table that uses uniqueidentifier as a primary
I have a SQL Server 2008 database with a table that contains a FILESTREAM
I have an audit table in my SQL Server 2008 database which contains the
I'm helping implement a SQL Server 2008 database and I have several columns that
I have a SQL Server 2008 database and a nvarchar(256) field of a table.
In a SQL Server 2008 database I have a table with a Date field
I have a SQL Server 2008 database. This database has a table called Product,
I have a simple database table (SQL Server 2008 R2 Express), which has a
I have a SQL Server 2008 database. This database has three tables: Person -
I have a SQL Server 2008 database where I would like to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.