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 8351841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:46:09+00:00 2026-06-09T08:46:09+00:00

I have a complex select query and a huge table. I’m running this select

  • 0

I have a complex select query and a huge table.

I’m running this select statement, meanwhile an Update statement arrives and tries to update the table.

IMHO – update requires an exclusive lock – so the update statement will have to wait till the select command is finished.

  1. Am I right ?

  2. what can I do in order to: execute the complex select, and also let the update command run (currently I don’t care about dirty data)

  • 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-09T08:46:10+00:00Added an answer on June 9, 2026 at 8:46 am

    Yes – to a degree.

    How long a SELECT holds on to a shared lock is depending on the isolation level of the transaction:

    • READ UNCOMMITTED – no shared lock is acquired at all – UPDATE is not blocked
    • READ COMMITTED – shared lock is acquired just for the duration of reading the data – UPDATE might be blocked for a very short period of time
    • REPEATABLE READ and SERIALIZABLE – shared lock is acquired and held on to until the end of the transaction – UPDATE is blocked until the SELECT transaction ends

    Technically, the UPDATE statement first gets an UPDATE lock – which is compatible with a shared lock (as used by the SELECT) – for the duration of the time while it’s reading the current values of the rows to be updated.

    Once that’s done, the Update lock is escalated to an exclusive lock for the new data to be written to the table.

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

Sidebar

Related Questions

I have been trying to convert a complex SELECT query to an UPDATE query,
I have a quite complex multi-join TSQL SELECT query that runs for about 8
I have a complex sorting problem with my SQL statement. I have a table
I have a select from (nothing to complex) Select * from VIEW This view
I have a complex report running in T-SQL, which in query analyzer was running
I have this complex (to me) requirement and would appreciate a SQL query for
I have a stored proc that performs a fairly complex SELECT statement. The stored
i have some complex select and result need to place in the table. I
I have a complex query, when I execute it, I get a big table
Here is my problem. I have a select statement something like this: select *

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.