Index locking
Encyclopedia
In database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

s an index
Index (database)
A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space...

is a data structure, part of the database, used by a database system to effectively navigate access to user data. Index data are system data distinct from user data, and consist primarily of pointers. As user data are changing in a database (by insert, delete, or modify operations), also indexes go over changes to maintain user data access correct. Index locking is a technique used to maintain index integrity. A portion of an index is locked during a database transaction when this portion is being accesses by the transaction as a result of attempt to access related user data. Also special database system's transactions (not user invoked transactions) may be invoked to maintain and modify an index, as part of a system's self-maintenance activities. When a portion of index is locked by a transaction, other transactions may be blocked from accessing this index portion (blocked from modifying, and even from reading it, depending on lock type and needed operation).

Specialized concurrency control
Concurrency control
In information technology and computer science, especially in the fields of computer programming , operating systems , multiprocessors, and databases, concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible.Computer...

 techniques exist for accessing indexes. These techniques depend on the index type, and take advantage of its structure. They are typically much more effective than applying to indexes common concurrency control methods applied to user data. Notable and have been widely researched are specialized techniques for B-tree
B-tree
In computer science, a B-tree is a tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree is a generalization of a binary search tree in that a node can have more than two children...

s (B-Tree concurrency control) which are regularly used as database indexes.

Index locks are used to coordinate thread
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

s accessing indexes concurrently, and typically shorter-lived than the common transaction locks on user data. Often they are called in the professional literature latch
Latch
Latch may refer to:* Latch , a type of door or window fastener* Latch , a circuit used to store information** A latching relay* Latch , lock on a system data-structure like an index...

es
.

See also

  • Index (database)
    Index (database)
    A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space...

  • Concurrency control
    Concurrency control
    In information technology and computer science, especially in the fields of computer programming , operating systems , multiprocessors, and databases, concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible.Computer...

  • Lock (database)
    Lock (database)
    A lock is used when multiple users need to access a database concurrently. This prevents data from being corrupted or invalidated when multiple users try to write to the database. Any single user can only modify those database records to which they have applied a lock that gives them exclusive...

  • B-Tree concurrency control
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK