Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit cdf8228

Browse files
READPAST do not block is not true and confusing
This is not accurate. Read operations that use READPAST may block in situation where the read involve page-level row it may block. - Remove this sentence : Read operations that use READPAST do not block - Add in the beginning : row-level locks are skipped but page-level locks are not skipped
1 parent 66c8b82 commit cdf8228

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/t-sql/queries/hints-transact-sql-table.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ FROM t WITH (TABLOCK, INDEX(myindex))
293293
Specifies that read operations comply with the rules for the READ COMMITTED isolation level by using locking. The [!INCLUDE[ssDE](../../includes/ssde-md.md)] acquires shared locks as data is read and releases those locks when the read operation is completed, regardless of the setting of the READ_COMMITTED_SNAPSHOT database option. For more information about isolation levels, see [SET TRANSACTION ISOLATION LEVEL (Transact-SQL)](../../t-sql/statements/set-transaction-isolation-level-transact-sql.md). This hint cannot be specified on the target table of an INSERT statement; error 4140 is returned.
294294

295295
READPAST
296-
Specifies that the [!INCLUDE[ssDE](../../includes/ssde-md.md)] not read rows that are locked by other transactions. When READPAST is specified, row-level locks are skipped. That is, the [!INCLUDE[ssDE](../../includes/ssde-md.md)] skips past the rows instead of blocking the current transaction until the locks are released. For example, assume table `T1` contains a single integer column with the values of 1, 2, 3, 4, 5. If transaction A changes the value of 3 to 8 but has not yet committed, a SELECT * FROM T1 (READPAST) yields values 1, 2, 4, 5. READPAST is primarily used to reduce locking contention when implementing a work queue that uses a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] table. A queue reader that uses READPAST skips past queue entries locked by other transactions to the next available queue entry, without having to wait until the other transactions release their locks.
296+
Specifies that the [!INCLUDE[ssDE](../../includes/ssde-md.md)] not read rows that are locked by other transactions. When READPAST is specified, row-level locks are skipped but page-level locks are not skipped. That is, the [!INCLUDE[ssDE](../../includes/ssde-md.md)] skips past the rows instead of blocking the current transaction until the locks are released. For example, assume table `T1` contains a single integer column with the values of 1, 2, 3, 4, 5. If transaction A changes the value of 3 to 8 but has not yet committed, a SELECT * FROM T1 (READPAST) yields values 1, 2, 4, 5. READPAST is primarily used to reduce locking contention when implementing a work queue that uses a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] table. A queue reader that uses READPAST skips past queue entries locked by other transactions to the next available queue entry, without having to wait until the other transactions release their locks.
297297

298-
READPAST can be specified for any table referenced in an UPDATE or DELETE statement, and any table referenced in a FROM clause. When specified in an UPDATE statement, READPAST is applied only when reading data to identify which records to update, regardless of where in the statement it is specified. READPAST cannot be specified for tables in the INTO clause of an INSERT statement. Read operations that use READPAST do not block. Update or delete operations that use READPAST may block when reading foreign keys or indexed views, or when modifying secondary indexes.
298+
READPAST can be specified for any table referenced in an UPDATE or DELETE statement, and any table referenced in a FROM clause. When specified in an UPDATE statement, READPAST is applied only when reading data to identify which records to update, regardless of where in the statement it is specified. READPAST cannot be specified for tables in the INTO clause of an INSERT statement. Update or delete operations that use READPAST may block when reading foreign keys or indexed views, or when modifying secondary indexes.
299299

300300
READPAST can only be specified in transactions operating at the READ COMMITTED or REPEATABLE READ isolation levels. When specified in transactions operating at the SNAPSHOT isolation level, READPAST must be combined with other table hints that require locks, such as UPDLOCK and HOLDLOCK.
301301

0 commit comments

Comments
 (0)