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

  • Home
  • SEARCH
  • 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 230135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:49:26+00:00 2026-05-11T19:49:26+00:00

I am reading SQL Server lock escalation from MSDN Page about SQL Server lock

  • 0

I am reading SQL Server lock escalation from MSDN Page about SQL Server lock escalation

My question is, seems the major reason why there is lock escalation is to reduce overhead to maintain more locks (e.g. when more row locks are acquired for a table, then row level lock is escalated to table level). My question is, to maintain more locks will improve concurrency, it is a benefit, why it is an overhead? In my humble idea, lock should be as small as enough to make the db performance better by improving concurrency. Could anyone explain in simple way why lock escalation is needed and what is the so-called lock overhead please?

thanks in advance,
George

  • 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-05-11T19:49:26+00:00Added an answer on May 11, 2026 at 7:49 pm

    Could anyone explain in simple way why lock escalation is needed and what is the so-called lock overhead please?

    When you update a table and lock a row, you need to record this fact somehow: that’s a row, it’s been updated and locked.

    When you update million rows, you need to do this million times, and therefore have some space to keep million locks.

    SQL Server keeps a list of locks in memory, while Oracle does in on the tablespaces.

    This is probably because Oracle is old (older than me), and SQL Server is young compared to Oracle.

    Keeping temporary resources (like locks) in a permanent storage is not so obvious solution from designer’s point of view. Just one thing to mention: you may need a disk write to perform a SELECT FOR UPDATE.

    Oracle’s core features were developed in early 80’s, when keeping things in memory was not an option at all. They just had to use disk space somehow.

    If disk space was to be used anyway, you had to place a lock somewhere on disk.

    And where to keep a lock for a row if not within the row itself?

    Developers of SQL Server’s lock system, when inventing design of their RDBMS called Sybase, decided to store temporary things (i. e. locks) in the temporary storage (i. e. RAM).

    But Oracle’s design is always balanced: if you have a 1,000,000 rows in your database, then you have a storage space for 1,000,000 locks, if you have a billion rows, you may store billion locks, etc.

    SQL Server’s design is flawy in this sense, because your RAM and HDD space may be unbalanced. You may easily have 16M of RAM and several terabytes of disk space. And you memory just cannot hold all the locks.

    That’s why when the lock count reaches a certain limit, SQL Server decides to escalate the locks: instead of keeping locks for, say, 10 individual rows in a data page (which requires 10 records), it locks the whole data page (which requires 1 record).

    Oracle, on the other hand, when updating a row, just writes the lock right into the datapage.

    That’s why Oracle’s locks are row-level.

    Oracle doesn’t “manage” the locks in a common sense of word: you can’t, say, get a list of locked pages in Oracle.

    When a transaction needs to update a row, it just goes to the row and sees if it’s locked.

    If it is, it looks which transaction holds a lock (this information is contained within the lock descriptor in the data page) and adds itself to that transaction’s notification queue: when the locking transactions dies, the original one gets notified and locks the data.

    From the concurrency’s point of view, lock escalation is totally a poor man’s solution: it adds nothing to concurrency. You can, say, get a lock on a row you didn’t even touch.

    From the performance’s point of view, doing things in memory is, of course, faster than doing them on the disk.

    But since Oracle caches the datablocks and the actual operations described above are performed in memory anyway, the performance is same or close to it.

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

Sidebar

Ask A Question

Stats

  • Questions 187k
  • Answers 187k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is as Pythonish as I can make it: (def… May 12, 2026 at 5:20 pm
  • Editorial Team
    Editorial Team added an answer byte[] byteArray = new byte[byteList.size()]; for (int index = 0;… May 12, 2026 at 5:20 pm
  • Editorial Team
    Editorial Team added an answer As for having an NSMutableString* and needing to return an… May 12, 2026 at 5:20 pm

Related Questions

Are these actually three different concepts or am I getting jumbled? (I've been reading
Before anyone votes to close this as a dupe, know that every question I
Can I really do this? As I am reading up on virtualization, I am
I am VERY new to ASP.NET. I come from a VB6 / ASP (classic)

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.