WO2022068289A1 - 一种数据访问方法、装置、设备及计算机可读存储介质 - Google Patents

一种数据访问方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2022068289A1
WO2022068289A1 PCT/CN2021/102471 CN2021102471W WO2022068289A1 WO 2022068289 A1 WO2022068289 A1 WO 2022068289A1 CN 2021102471 W CN2021102471 W CN 2021102471W WO 2022068289 A1 WO2022068289 A1 WO 2022068289A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
memory
data
data page
storage address
Prior art date
Application number
PCT/CN2021/102471
Other languages
English (en)
French (fr)
Inventor
王天宇
Original Assignee
北京金山云网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京金山云网络技术有限公司 filed Critical 北京金山云网络技术有限公司
Publication of WO2022068289A1 publication Critical patent/WO2022068289A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models

Definitions

  • the present disclosure relates to the field of information technology, and in particular, to a data access method, apparatus, device, and computer-readable storage medium.
  • the related art uses a hash table to manage memory, which is mainly reflected in the insertion, deletion, and search of data in the memory. Under normal circumstances, before inserting, deleting, searching and other access processing of data in memory, it is necessary to lock the hash table.
  • the present disclosure provides a data access method, apparatus, device, and computer-readable storage medium.
  • an embodiment of the present disclosure provides a data access method, including: acquiring a data access request, where the data access request includes identification information of target data to be accessed; The corresponding data structure is traversed, and the first node and the second node in the data structure are determined, wherein the first node is a child node of the second node, and the first node includes the target data. identification information; if the second node includes the storage address in the memory of the first data page corresponding to the first node, the second node is locked, and according to the storage address of the first data page in the memory The storage address is to release the lock on the second node after accessing the first data page stored in the memory.
  • an embodiment of the present disclosure provides a data access device, including: an acquisition module, a traversal module, a determination module, and an access module; wherein the acquisition module is configured to acquire a data access request, and the data access request includes a target to be accessed identification information of the data; the traversal module is set to traverse the data structure corresponding to the database according to the identification information of the target data to be accessed; the determination module is set to determine the first node and the second node in the data structure, wherein the The first node is a child node of the second node, and the first node includes the identification information of the target data; the access module is set to if the second node includes the first data page corresponding to the first node the storage address in the memory, then lock the second node, and according to the storage address of the first data page in the memory, after accessing the first data page stored in the memory, release the the lock on the second node.
  • embodiments of the present disclosure provide a data access device, including: a memory, a processor, and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to A method as described in the first aspect is implemented.
  • an embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium can store a program, and when the program is executed, each implementation of the method provided in the first aspect of the present disclosure can be implemented. some or all of the steps in the method.
  • the above technical solutions provided by the embodiments of the present disclosure have the following advantages: traversing the data structure corresponding to the database through the identification information of the target data to be accessed, and determining the first data structure with a parent-child relationship from the data structure A node and a second node, wherein the first node is a child node of the second node, and the first node includes identification information of the target data.
  • the data structure is not only an organization form of data in the database, but also is used to manage memory, that is to say, in this embodiment, it is not necessary to specially set up a hash table to manage memory.
  • the storage address of the data page corresponding to the child node in the memory may be recorded in the parent node of the child node.
  • a thread needs to access the data page corresponding to a child node in memory, it only needs to lock the parent node of the child node, because the number of child nodes under a parent node is limited to several child nodes , therefore, locking a parent node only prevents other threads from accessing the data pages corresponding to the limited number of child nodes in the memory, and will not cause other threads to be unable to access all or most of the data pages in the memory.
  • FIG. 1 is a schematic diagram of a data structure in the related art
  • FIG. 2 is a schematic structural diagram of a hash table according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a data access method provided by an embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of a data structure provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a data access device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a data access device provided by an embodiment of the present disclosure.
  • a relational database (MySQL) is used as an example.
  • the relational database stores data in different tables instead of storing all data in one large warehouse. That is, a relational database includes multiple tables.
  • the data in each table is organized by a certain data structure.
  • the data structure may be a tree-like data structure, and this embodiment takes the data structure of B+Tree as an example for schematic illustration.
  • a table in a relational database corresponds to a B+Tree data structure. Among them, a table in a relational database can also be called a file.
  • the data structure is not limited to B+Tree, for example, it can also be a binary search tree, a balanced binary tree (AVL Tree), a balanced multipath search tree (B-Tree), and the like.
  • B+Tree is an optimization based on B-Tree.
  • B+Tree can also be called a balanced multi-path search tree, that is to say, the balanced multi-path search tree includes two structures of B-Tree and B+Tree.
  • the database is stored in an external storage device of the computer, and the external storage device may be referred to as external storage for short.
  • the external storage device may be, for example, a magnetic disk, a hard disk, or the like.
  • the internal storage device of the computer may be simply referred to as the memory, and the memory may be, for example, the internal memory of the computer.
  • the memory is used to store the intermediate data and calculation results of the central processing unit (Central Processing Unit, CPU) operation.
  • CPU Central Processing Unit
  • frequently accessed data in the database can also be stored in memory.
  • the basic unit is the disk block, and the data located in the same disk block will be read out at one time.
  • FIG. 1 is a schematic diagram of a B+Tree data structure in the related art.
  • the B+Tree data structure includes a root node, a non-leaf node and a leaf node.
  • each node occupies one disk block of disk space.
  • node 1 is the root node
  • node 2 and node 3 are non-leaf nodes
  • node 4 to node 9 are leaf nodes.
  • Node 1 occupies disk block 1
  • node 2 occupies disk block 2
  • node 9 occupies disk block 9.
  • a table in a relational database can include multiple records, and each record can occupy a row in the table, so a record can also be called a row record.
  • each record can be recorded as a two-tuple [key, data].
  • key represents the key value of the record, that is, the primary key value of the record in the corresponding table.
  • data represents data other than the primary key value in a record.
  • the key values are different from each other.
  • leaf nodes include primary key values and data. Nodes other than leaf nodes, for example, root nodes and non-leaf nodes include a primary key value and a pointer, and the pointer may specifically be an address of a disk block occupied by a child node. The address of the disk block may specifically be the address of the disk block in the disk.
  • node 2 and node 3 are respectively child nodes of the root node.
  • the root node includes a pointer p2 and a pointer p3, where p2 represents the address of the disk block occupied by node 2, and p3 represents the address of the disk block occupied by node 3.
  • the number of primary key values in the node may not be specifically limited. However, the primary key values in each node are sorted in ascending order. Take node 2 as an example for schematic illustration. The two primary key values in node 2 are 10 and 17, the primary key value of the child node pointed to by pointer p4 is less than 10, and the primary key value of the child node pointed to by pointer p5 is between 10- Between 17, the primary key value of the child node pointed to by the pointer p6 is greater than or equal to 17.
  • Keyword 29 is found in disk block 7.
  • the memory may perform data caching in units of data pages. For example, one data page in the memory may cache all the content in one node of the B+Tree. In some other embodiments, a data page may also cache the contents of multiple nodes with consecutive addresses in the B+Tree. That is to say, in this embodiment, the content in some nodes of the B+Tree may be cached in the memory in the form of data pages. A node in B+Tree can correspond to a data page in memory.
  • These data pages cached in the memory may be data pages that are being accessed, or may be hot data pages, that is, data pages that are frequently accessed.
  • the memory may specifically be a memory pool (BufferPool).
  • the memory is managed by means of a hash table. For example, data pages corresponding to node 1, data pages corresponding to node 3, and data pages corresponding to node 7 are cached in the memory as shown in FIG. 1 .
  • the identifier of node 1 may be recorded as spaceid+pageno1, where spaceid represents the identifier of the file corresponding to B+Tree, for example, the file name. pageno1 represents the offset of node 1 in this file.
  • the file names corresponding to node 1, node 3 and node 7 are the same, the identifier of node 3 can be recorded as spaceid+pageno3, and the identifier of node 7 can be recorded as It is spaceid+pageno7. It can be understood that the identifier of each node may be the address of the disk block occupied by the node.
  • each hash value corresponds to a position in the hash table, and each position in the hash table is used to store a storage address in the memory of a data page corresponding to a node.
  • the location corresponding to the hash value 1 stores the storage address of the data page corresponding to the node 1 in the memory
  • the location corresponding to the hash value 3 stores the storage address of the data page corresponding to the node 3 in the memory
  • the location corresponding to the hash value 7 stores the storage address of the data page corresponding to the node 7 in the memory.
  • the B+Tree is traversed according to the primary key value of the target data to be accessed.
  • the traversal process is as described above, and will not be repeated here.
  • the primary key value of the target data is 29, and the target data is data corresponding to the primary key value 29.
  • calculate the hash value of the identifier according to the identifier of node 7 query the hash table shown in Figure 2, and determine whether the location corresponding to the hash value of the identifier is stored If there is information, if there is no information stored in this location, it means that the data page corresponding to node 7 is not cached in the memory.
  • the corresponding address information is stored in this location, it means that the data page corresponding to the node 7 is in the memory.
  • the data page corresponding to the node 7 cached in the memory can be accessed, for example, read, write, modify, delete, etc.
  • the data page corresponding to the node 7 may include multiple records. Therefore, when accessing the data page corresponding to the node 7 cached in the memory, it is possible to read some or all of the records. , write, modify, delete, etc.
  • each thread can lock the hash table before accessing a data page, and release the hash table after the data access is completed. Lock.
  • the accessed target data is not in the memory, it is also necessary to write the content in the disk block to which the target data belongs to the memory, and record the storage address of the data page corresponding to the content in the memory in the hash table.
  • the primary key value of the target data is 75.
  • the hash table is queried to determine The hash table does not store the storage address of the data page corresponding to the node 8 in the memory. That is to say, the data page corresponding to node 8 is not in the memory.
  • the content in the disk block 8 needs to be read from the disk, and the content in the disk block 8 needs to be written into a new data page in the memory. That is, a page of data needs to be inserted in memory.
  • the implementation of this insert operation is as follows:
  • the hash table needs to be locked, that is, mutual exclusion needs to be performed at the granularity of the hash table. Since the hash table manages the entire memory, locking the hash table is equivalent to locking the entire memory.
  • the CPU fetches data from the memory, not directly from the disk. If the data accessed by the CPU is not in the memory, the corresponding data in the disk needs to be cached in the memory. Therefore, when a thread adds a mutex to the hash table, other threads cannot access the memory, and it is impossible to determine whether the data accessed by the thread is in the memory, and thus cannot fetch data from the disk.
  • locking the hash table is equivalent to locking the entire database. Therefore, the memory is the basis of the logical calculation of the database, and the concurrency capability of the memory directly affects the throughput of the database and the performance of the system. Therefore, in high concurrency scenarios, locking the hash table will cause memory access to become a performance bottleneck, resulting in lower system performance. Even if the hash table is divided into multiple parts and the parts of the hash table are locked, the problem of low performance of the computer system cannot be fundamentally solved.
  • an embodiment of the present disclosure provides a data access method, which is described below with reference to specific embodiments.
  • FIG. 3 is a flowchart of a data access method provided by an embodiment of the present disclosure. The specific steps of this method are as follows:
  • the identification information of the target data to be accessed may specifically be the primary key value of the target data to be accessed.
  • the identification information of the target data to be accessed traverse the data structure corresponding to the database, and determine the first node and the second node in the data structure, wherein the first node is of the second node.
  • the storage address of the data page in the memory may be added in the node corresponding to the data page.
  • the address of the disk block occupied by the node as described above may be recorded as the first A pointer, recording the storage address of the data page in the memory as the second pointer. That is to say, if the data page corresponding to a node in the B+Tree is cached in the memory, the node includes both the first pointer and the second pointer. If the data page corresponding to a node in the B+Tree is not in the memory, the node includes the first pointer and does not include the second pointer.
  • data pages corresponding to node 1, node 2, node 3, node 7, node 8, and node 9 as shown in FIG. 4 are cached in the memory respectively.
  • the storage address of the data page corresponding to node 1 in the memory is marked as Father_pointer_page1
  • the storage address of the data page corresponding to node 2 in the memory is marked as Child_pointer_page2
  • the storage address of the data page corresponding to node 3 in the memory is marked as Child_pointer_page3
  • the storage address of the data page corresponding to node 7 in the memory is marked as Child_pointer_page7
  • the storage address of the data page corresponding to node 8 in the memory is marked as Child_pointer_page8
  • the storage address of the data page corresponding to node 9 in the memory is marked as Child_pointer_page9.
  • p2 and Child_pointer_page2 as an example, in node 1, there may be a correspondence between p2 and Child_pointer_page2. Specifically, p2 is the first pointer, and Child_pointer_page2 is the second pointer. p2 represents the location of disk block 2 occupied by node 2, and Child_pointer_page2 represents the storage address of the data page corresponding to node 2 in memory.
  • Child_pointer_page2 and Child_pointer_page3 can be recorded in node 1. There may be a correspondence between pointer p3 and Child_pointer_page3.
  • node 3 is the parent node of node 7 , node 8 and node 9 , Child_pointer_page7 , Child_pointer_page8 , and Child_pointer_page9 may be recorded in node 3 .
  • the child node may also record the storage address in the memory of the data page corresponding to the parent node.
  • the node 7, the node 8, and the node 9 respectively record the Father_pointer_page3, and the Father_pointer_page3 represents the storage address of the data page corresponding to the node 3 in the memory. That is, Father_pointer_page3 in Node 7, Node 8, and Node 9 is the same as Child_pointer_page3 recorded in Node 1.
  • node 2 and node 3 respectively record the storage address of the data page corresponding to node 1 in the memory, that is, Father_pointer_page1.
  • the B+Tree shown in FIG. 4 is not only the data structure corresponding to the database, but also can be used to manage the memory. to manage.
  • the B+Tree shown in FIG. 4 can be traversed.
  • the data structure is a tree-like data structure; the traversing the data structure corresponding to the database includes: starting from the root node, traversing the data structure corresponding to the database.
  • node 1 is the root node
  • the primary key value of the target data is 29.
  • the B+Tree is traversed from the root node. Specifically, the access starts from the root node to the leaf nodes.
  • the specific traversal process includes the following steps:
  • Child_pointer_page3 According to Child_pointer_page3, read the data page corresponding to node 3 from the memory, compare the primary key value 29 with the interval (36,79), select the pointer p7, and read Child_pointer_page7.
  • Child_pointer_page7 Read the data page corresponding to node 7 from the memory, and find the keyword 29 in the data page.
  • node 7 and node 3 can be determined, wherein node 7 is the child node of node 3 , and node 3 is the parent node of node 7 .
  • Node 7 includes the primary key value 29 of the target data.
  • the node 7 including the primary key value 29 of the target data may be denoted as the first node, and the node 3 may be denoted as the second node.
  • the second node includes the storage address in the memory of the first data page corresponding to the first node, lock the second node, and store the first data page in the memory according to the storage address of the first data page in the memory. address, after accessing the first data page stored in the memory, release the lock on the second node.
  • the node 3 since the node 3 includes the storage address of the data page corresponding to the node 7 in the memory, namely Child_pointer_page7, it means that the data page corresponding to the node 7 is in the memory. Therefore, the data page corresponding to the node 7 stored in the memory can be directly accessed. Specifically, when a thread in the computer system needs to access the data page corresponding to the node 7 stored in the memory, the thread can first lock the node 3, and then store the data page in the memory according to the data page corresponding to the node 7. The address is Child_pointer_page7, find the data page corresponding to node 7 stored in the memory, access the data page corresponding to node 7, and release the lock on node 3 after the access. When accessing the data page corresponding to the node 7, operations such as deleting, modifying, writing, and reading may be performed on all or part of the records in the data page.
  • the first node if the second node includes a storage address in the memory of the first data page corresponding to the first node, the first node further includes a second data page corresponding to the second node.
  • the storage address in memory.
  • node 7 is the child node of node 3
  • node 3 is the parent node of node 7
  • Node 7 is denoted as the first node
  • node 3 is denoted as the second node.
  • the node 7 may also include the storage address of the data page corresponding to the node 3 in the memory, that is, Father_pointer_page3.
  • the data page corresponding to the first node may be recorded as the first data page
  • the data page corresponding to the second node may be recorded as the second data page.
  • the embodiment of the present disclosure traverses the data structure corresponding to the database through the identification information of the target data to be accessed, and determines the first node and the second node having a parent-child relationship from the data structure, wherein the first node is the second node A child node of the node, the first node includes identification information of the target data.
  • the data structure is not only an organization form of data in the database, but also is used to manage memory, that is to say, in this embodiment, it is not necessary to specially set up a hash table to manage memory.
  • the storage address of the data page corresponding to the child node in the memory may be recorded in the parent node of the child node.
  • a thread needs to access the data page corresponding to a child node in memory, it only needs to lock the parent node of the child node, because the number of child nodes under a parent node is limited to several child nodes , therefore, locking a parent node only prevents other threads from accessing the data pages corresponding to the limited number of child nodes in the memory, and will not cause other threads to be unable to access all or most of the data pages in the memory.
  • locking the second node includes: locking the storage address in the memory of the first data page included in the second node.
  • node 3 includes Child_pointer_page7, Child_pointer_page8, and Child_pointer_page9. Therefore, when locking node 3, only Child_pointer_page7, Child_pointer_page8, and Child_pointer_page9 may be locked, or only Child_pointer_page7 may be locked.
  • the locked data granularity can be reduced, thereby improving computer performance.
  • the second node is locked, and the first data page stored in the memory is accessed according to the storage address of the first data page in the memory, and then the first data page is released.
  • the lock on the second node includes the following possible situations:
  • a possible situation is: lock the second node, and release the first data page stored in the memory after accessing the first data page stored in the memory according to the storage address of the first data page in the memory.
  • the lock on the second node includes: adding a mutual exclusion lock to the second node, and deleting the first data page or the first data page stored in the memory according to the storage address of the first data page in the memory After deleting some records in the first data page, release the mutual exclusion lock on the second node.
  • the implementation process of the delete operation is as follows:
  • node 3 is a non-leaf node and node 7 is a leaf node. Since node 3 and node 7 are related to each other, node 7 and node 3 are related leaves. Nodes and non-leaf nodes. Since leaf nodes can be queried from non-leaf nodes. Therefore, in the memory, the access frequency of data pages corresponding to non-leaf nodes is higher than that of data pages corresponding to leaf nodes. Therefore, when deleting a data page in the memory, the data page corresponding to the leaf node may be preferentially deleted.
  • the method further includes: deleting all data pages included in the first node. the storage address in the memory of the second data page corresponding to the second node.
  • the thread can also delete the storage address in the memory of the data page corresponding to node 3 included in the node 7, that is, Father_pointer_page3, or assign Father_pointer_page3 to NULL.
  • the process is detailed as follows:
  • the data page corresponding to a node is cached in memory, when the data page corresponding to a node is deleted, it does not mean that the node is deleted from the data structure, but only from the node. Delete the storage address in the memory of the data page corresponding to the node from the parent node of the node, and delete the storage address in the memory of the data page corresponding to the parent node included in the deletion. The parent-child relationship between the node and its parent node still exists in the data structure.
  • the lock on the second node includes: adding a shared lock to the second node, and reading the first data page or the first data page from the memory according to the storage address of the first data page in the memory. After some records in the first data page are read, the shared lock on the second node is released.
  • a thread needs to read the data page corresponding to node 7 in the memory or some records in the data page.
  • the implementation process of the read operation is as follows:
  • the data page corresponding to the node 7 is read from the memory or some records in the data page are read from the memory.
  • Another possible situation is: lock the second node, and release the first data page stored in the memory after accessing the first data page stored in the memory according to the storage address of the first data page in the memory.
  • the lock on the second node includes: adding a mutual exclusion lock to the second node, and according to the storage address of the first data page in the memory, locking the first data page stored in the memory After some or all of the records are modified, the mutual exclusion lock on the second node is released.
  • Child_pointer_page7 in the node 3 find the data page corresponding to the node 7 in the memory, and modify all or part of the records in the data page corresponding to the node 7.
  • Another possible situation is: lock the second node, and release the first data page stored in the memory after accessing the first data page stored in the memory according to the storage address of the first data page in the memory
  • the lock on the second node includes: adding a mutual exclusion lock to the second node, and storing the first data page in the memory according to the storage address of the first data page in the memory After writing a new record in the second node, release the mutex lock on the second node.
  • a thread needs to write a new record in the data page corresponding to node 7 in the memory.
  • the implementation process of the write new record operation is as follows:
  • Child_pointer_page7 in the node 3 find the data page corresponding to the node 7 in the memory, and write a new record in the data page corresponding to the node 7.
  • the data page is accessed, for example, all or part of the records in the data page are read, Delete all or part of the records in the data page, modify all or part of the records in the data page, write new records in the data page, etc., and release the lock on the parent node after the corresponding access operation is completed .
  • the method of locking the parent node in this embodiment greatly reduces the data granularity of the lock, thereby preventing memory access from becoming a performance bottleneck in a high concurrency scenario. The throughput of the database is guaranteed, thereby effectively improving the performance of the computer system.
  • the method further includes: if the second node does not include a storage address in the memory of the first data page corresponding to the first node, adding a mutual exclusion lock to the second node, After caching the first data page corresponding to the first node in the memory, write the storage address of the first data page in the memory in the second node, and release the storage address on the second node. Mutex.
  • the primary key value of the target data is 29.
  • node 7 and node 3 are determined, and node 7 is recorded as The first node, node 3 is recorded as the second node.
  • node 3 includes Child_pointer_page8 and Child_pointer_page9, but does not include Child_pointer_page7, indicating that the data page corresponding to node 7 is not in memory.
  • the method further includes: writing, in the first node, the storage of the second data page corresponding to the second node in the memory address.
  • the fast traversal of the B+Tree can be realized, This enables fast access to data pages in memory.
  • FIG. 5 is a schematic structural diagram of a data access apparatus provided by an embodiment of the present disclosure.
  • the data access apparatus provided by the embodiment of the present disclosure can execute the processing flow provided by the data access method embodiment.
  • the data access apparatus 50 includes:
  • the obtaining module 51 is configured to obtain a data access request, and the data access request includes the identification information of the target data to be accessed;
  • the traversal module 52 is configured to traverse the data structure corresponding to the database according to the identification information of the target data to be accessed;
  • the determining module 53 is configured to determine a first node and a second node in the data structure, wherein the first node is a child node of the second node, and the first node includes the identifier of the target data information;
  • the access module 54 is configured to lock the second node if the second node includes the storage address in the memory of the first data page corresponding to the first node, and store the first data page according to the first data page. The storage address in the memory, after the first data page stored in the memory is accessed, the lock on the second node is released.
  • the first node if the second node includes a storage address in the memory of the first data page corresponding to the first node, the first node further includes a second data page corresponding to the second node.
  • the storage address in memory.
  • the data structure is a tree-like data structure; the traversal module 52 is specifically configured to: traverse the data structure corresponding to the database starting from the root node.
  • the access module 54 is specifically configured to: add a mutual exclusion lock to the second node, and delete the first data page stored in the memory according to the storage address of the first data page in the memory. After the data page or some records in the first data page are deleted, the mutual exclusion lock on the second node is released.
  • the access module 54 is further configured to: delete all data pages included in the first node. the storage address in the memory of the second data page corresponding to the second node.
  • the access module 54 is specifically set as:
  • the access module 54 is specifically set as:
  • the access module 54 is specifically set as:
  • the access module 54 when the access module 54 locks the second node, it is specifically configured to: lock the storage address in the memory of the first data page included in the second node.
  • the access module 54 is further configured to: if the second node does not include the storage address in the memory of the first data page corresponding to the first node, add a mutual exclusion lock to the second node. , after caching the first data page corresponding to the first node in the memory, write the storage address of the first data page in the memory in the second node, and release the second node the mutex lock.
  • the access module 54 is further configured to: write the second data page corresponding to the second node in the memory in the first node. storage address.
  • the data access apparatus in the embodiment shown in FIG. 5 can be used to implement the technical solutions of the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and will not be repeated here.
  • FIG. 6 is a schematic structural diagram of a data access device provided by an embodiment of the present disclosure.
  • the data access device provided by the embodiment of the present disclosure can execute the processing flow provided by the data access method embodiment.
  • the data access device 60 includes: a memory 61, a processor 62, a computer program, and a communication interface 63; Programs are stored in the memory 61 and are configured to be executed by the processor 62 to perform the data access methods described above.
  • an embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium can store a program, and when the program is executed, a part of each implementation manner of the data access method provided by the above-mentioned embodiments can be implemented. or all steps.
  • the data access method provided by the embodiments of the present disclosure can effectively reduce the granularity of data to be locked, thereby preventing memory access from becoming a performance bottleneck in a high concurrency scenario, ensuring the throughput of the database, thereby effectively improving the performance of the computer system, and has strong performance. of industrial applicability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

提供一种数据访问方法、装置、设备及计算机可读存储介质。通过待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历,从数据结构中确定出具有父子关系的第一节点和第二节点,其中,第一节点是第二节点的子节点,第一节点包括目标数据的标识信息。由于数据结构不仅是数据库中数据的组织形式,同时数据结构还用于管理内存,也就是说不需要专门设立哈希表对内存进行管理。从而在内存粒度上实现了无锁化,由于只是在数据页的粒度上加锁,因此大大减小了加锁的数据粒度,从而在高并发场景下,避免内存访问成为性能瓶颈,保证了数据库的吞吐量,从而有效提高了计算机系统性能。

Description

一种数据访问方法、装置、设备及计算机可读存储介质
本公开要求于2020年9月29日提交中国专利局、申请号为202011049612.1、发明名称为“一种数据访问方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及信息技术领域,尤其涉及一种数据访问方法、装置、设备及计算机可读存储介质。
背景技术
随着信息技术的不断发展,人们在工作和生活中会产生大量的数据,通常情况下会将这些大量的数据存储到数据库中。其中,数据库中经常被访问的数据可以存储在内存中。
相关技术采用哈希表的方式管理内存,主要体现在内存中数据的插入、删除、查找等方面。通常情况下,在对内存中的数据进行插入、删除、查找等访问处理之前,需要给哈希表加锁。
当计算机系统中的某个线程给哈希表加互斥锁后,将导致其他线程无法对内存中的数据进行访问,从而导致计算机系统性能降低。即使将哈希表拆分为多个部分,给哈希表的部分加互斥锁,也并不能从根本上解决计算机系统性能低的问题。
发明内容
为了解决上述技术问题,本公开提供了一种数据访问方法、装置、设备及计算机可读存储介质。
第一方面,本公开实施例提供了一种数据访问方法,包括:获取数据访问请求,所述数据访问请求包括待访问的目标数据的标识信息;根据待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历,确定所述数据结构中的第一节点和第二节点,其中,所述第一节 点是所述第二节点的子节点,所述第一节点包括所述目标数据的标识信息;若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁。
第二方面,本公开实施例提供一种数据访问装置,包括:获取模块、遍历模块、确定模块和访问模块;其中,获取模块设置为获取数据访问请求,所述数据访问请求包括待访问的目标数据的标识信息;遍历模块设置为根据待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历;确定模块设置为确定所述数据结构中的第一节点和第二节点,其中,所述第一节点是所述第二节点的子节点,所述第一节点包括所述目标数据的标识信息;访问模块设置为若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁。
第三方面,本公开实施例提供一种数据访问设备,包括:存储器、处理器、以及计算机程序;其中,所述计算机程序存储在所述存储器中,并被配置为由所述处理器执行以实现如第一方面所述的方法。
第四方面,本公开实施例还提供一种计算机可读存储介质,其中,该计算机可读存储介质可存储有程序,该程序执行时可实现本公开第一方面提供的所述方法的各实现方式中的部分或全部步骤。
本公开实施例提供的上述技术方案与相关技术相比具有如下优点:通过待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历,从该数据结构中确定出具有父子关系的第一节点和第二节点,其中,第一节点是第二节点的子节点,第一节点包括目标数据的标识信息。由于该数据结构不仅是数据库中数据的组织形式,同时该数据结构还用于管理内存,也就是说在本实施例中不需要专门设立哈希表对内存进行管理。另外,在本实施例中,当子节点对应的数据页已经缓存在内存时,可以在该子节点的父节点中记录该子节点对应的数据页在内存中的存储地址。如此,当某个线程需要访问内存中某个子节点 对应的数据页时,只需对该子节点的父节点进行加锁即可,由于一个父节点下的子节点个数是有限的几个子节点,因此,对一个父节点进行加锁,只是避免其他线程对内存中该有限个子节点对应的数据页进行访问,不会导致其他线程无法对内存中所有的数据页或大部分的数据页进行访问,从而在内存粒度上实现了无锁化,由于只是在数据页的粒度上加锁,因此大大减小了加锁的数据粒度,从而在高并发场景下,避免内存访问成为性能瓶颈,保证了数据库的吞吐量,从而有效提高了计算机系统性能。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为相关技术中的一种数据结构的示意图;
图2为本公开实施例提供的一种哈希表的结构示意图;
图3为本公开实施例提供的数据访问方法流程图;
图4为本公开实施例提供的一种数据结构的示意图;
图5为本公开实施例提供的数据访问装置的结构示意图;
图6为本公开实施例提供的数据访问设备的结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开的一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
通常情况下,人们在工作和生活中产生的大量数据可以存储到数 据库中。数据库的类型有很多,本实施例以关系型数据库(MySQL)为例,关系型数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内。也就是说,关系型数据库包括多个表。另外,每个表中的数据是通过一定的数据结构组织起来的。该数据结构可以是树状的数据结构,本实施例以B+Tree的数据结构为例进行示意性说明。关系型数据库中的一个表对应一个B+Tree的数据结构。其中,关系型数据库中的一个表也可以称为一个文件。可以理解的是,在其他实施例中,数据结构不限于B+Tree,例如还可以是二叉查找树、平衡二叉树(AVL Tree)、平衡多路查找树(B-Tree)等。其中,B+Tree是在B-Tree的基础上的一种优化。其中,B+Tree也可称为平衡多路查找树,也就是说,平衡多路查找树包括B-Tree和B+Tree这两种结构。
通常情况下,数据库存储在计算机的外部存储设备中,外部存储设备可以简称为外存。外部存储设备例如可以是磁盘、硬盘等。相对于计算机的外部存储设备,计算机的内部存储设备可简称为内存,内存例如可以是计算机内部的存储器。内存用于存储中央处理器(Central Processing Unit,CPU)运算的中间数据和计算结果。另外,数据库中经常被访问的数据也可以存储在内存中。计算机系统从磁盘中读取数据到内存时是以磁盘块为基本单位的,位于同一个磁盘块中的数据会被一次性读取出来。
如图1所示为相关技术中B+Tree数据结构的示意图。如图1所示,B+Tree数据结构包括根节点、非叶子节点和叶子节点。其中,每个节点占用一个磁盘块的磁盘空间。具体的,节点1是根节点,节点2和节点3是非叶子节点,节点4-节点9是叶子节点。节点1占用磁盘块1,节点2占用磁盘块2,依次类推,节点9占用磁盘块9。
另外,关系型数据库中的一个表可包括多条记录,每条记录可占用该表的一行,因此,一条记录也可称为一行记录。具体的,每条记录可记为一个二元组[key,data]。其中,key表示该条记录的键值,即该条记录在对应表中的主键值。data表示一条记录中除主键值外的数据。对于不同的记录,key值互不相同。如图1所示,叶子节点包括主键值和数据。除叶子节点之外的其他节点,例如,根节点和非叶子节点包括主键值和指针,该指针具体可以是子节点所占用的磁盘块的地址。 其中,磁盘块的地址具体可以是磁盘块在磁盘中的地址。
例如,以如图1所示的根节点为例,节点2和节点3分别是根节点的子节点。根节点包括指针p2和指针p3,p2表示节点2占用的磁盘块的地址,p3表示节点3占用的磁盘块的地址。
另外,如图1所示,对于每个节点而言,该节点中的主键值个数可以不做具体限定。但是,每个节点中的主键值是按升序排序的。以节点2为例进行示意性说明,节点2中的两个主键值为10和17,指针p4指向的子节点的主键值小于10,指针p5指向的子节点的主键值在10-17之间,指针p6指向的子节点的主键值大于或等于17。
下面以查找主键值29为例,结合图1介绍一下遍历B+Tree的过程:
1、根据根节点找到磁盘块1,将磁盘块1中的内容读入内存,即进行第1次磁盘输入/输出(Input/Output,I/O)操作。
2、比较主键值29和根节点中的主键值28,由于主键值29大于主键值28,因此选取主键值28右侧的指针p3。
3、根据指针p3找到磁盘块3,将磁盘块3中的内容读入内存,即进行第二次磁盘I/O操作。
4、比较主键值29和区间(36,79),找到磁盘块3中的指针p7。
6、根据指针p7找到磁盘块7,将磁盘块7中的内容读入内存,即进行第三次磁盘I/O操作。
7、在磁盘块7中找到关键字29。
通常情况下,数据库中经常被访问的数据可以存储在内存中。在本公开实施例中,内存可以以数据页为单位进行数据缓存,例如,内存中的一个数据页可以缓存B+Tree一个节点中的全部内容。在其他一些实施例中,一个数据页也可以缓存B+Tree多个地址连续的节点中的内容。也就是说,在本实施例中,B+Tree的一些节点中的内容可以以数据页的形式缓存在内存中。B+Tree中的一个节点可以对应内存中的一个数据页。内存中缓存的这些数据页可以是正在被访问的数据页,也可以是热点数据页即被访问频率较高的数据页。另外,在本公开实施例中,内存具体可以是内存池(BufferPool)。
当前采用哈希表的方式对内存进行管理。例如,内存中缓存有如 图1所示的节点1对应的数据页、节点3对应的数据页和节点7对应的数据页。节点1的标识可记为spaceid+pageno1,其中,spaceid表示B+Tree对应的文件的标识,例如,文件名。pageno1表示节点1在该文件中的偏移量。由于节点1、节点3和节点7在同一个B+Tree中,因此,节点1、节点3和节点7对应的文件名相同,节点3的标识可记为spaceid+pageno3,节点7的标识可记为spaceid+pageno7。可以理解的是,每个节点的标识可以是该节点占用的磁盘块的地址。在构建哈希表时,分别计算spaceid+pageno1、spaceid+pageno3和spaceid+pageno7的哈希值,例如,spaceid+pageno1的哈希值记为哈希值1,spaceid+pageno3记为哈希值3,spaceid+pageno7的哈希值记为哈希值7。在该哈希表中,每个哈希值对应哈希表中的一个位置,哈希表中的每个位置用于存储一个节点对应的数据页在内存中的存储地址。如图2所示,哈希值1对应的位置存储有节点1对应的数据页在内存中的存储地址,哈希值3对应的位置存储有节点3对应的数据页在内存中的存储地址,哈希值7对应的位置存储有节点7对应的数据页在内存中的存储地址。
在数据访问过程中,根据待访问的目标数据的主键值对B+Tree进行遍历,遍历的过程如上所述,此处不再赘述。例如,目标数据的主键值为29,该目标数据是与主键值29对应的数据。当确定出该目标数据所在的节点为节点7时,根据节点7的标识计算该标识的哈希值,查询如图2所示的哈希表,确定该标识的哈希值对应的位置是否存储有信息,若该位置中没有存储任何信息,则说明节点7对应的数据页没有缓存在内存中。若该位置存储有相应的地址信息,说明节点7对应的数据页在内存中,此时,可以对内存中缓存的该节点7对应的数据页进行访问,例如,读取、写入、修改、删除等操作。具体的,节点7对应的数据页可包括多条记录,因此,对内存中缓存的该节点7对应的数据页进行访问时,具体可以对该多条记录中的部分记录或全部记录进行读取、写入、修改、删除等操作。
为了避免计算机系统中不同线程对内存中同一数据页的访问产生冲突,每个线程在访问某一数据页之前,可以先给哈希表加锁,数据访问完成后,再释放哈希表上的锁。
例如,以删除操作为例,具体实现过程如下所述:
1)对哈希表加互斥锁。
2)删除内存中缓存的节点7对应的数据页,或删除该数据页中的部分记录。
3)释放哈希表上的互斥锁。
例如,以读取操作为例,具体实现过程如下所述:
1)对哈希表加共享锁。
2)从内存中读取节点7对应的数据页,或者内存中读取该数据页中的部分记录。
3)释放哈希表上的共享锁。
例如,以写入操作为例,具体实现过程如下所述:
1)对哈希表加互斥锁。
2)在内存中缓存的节点7对应的数据页中写入新的记录。
3)释放哈希表上的互斥锁。
例如,以修改操作为例,具体实现过程如下所述:
1)对哈希表加互斥锁。
2)修改内存中缓存的节点7对应的数据页,或者修改该数据页中的部分记录。
3)释放哈希表上的互斥锁。
此外,如果访问的目标数据不在内存时,还需要将目标数据所属的磁盘块中的内容写入到内存中,并在哈希表中记录该内容在内存中对应的数据页的存储地址。
例如,目标数据的主键值为75,通过对B+Tree进行遍历,确定该目标数据在节点8上,但是,在计算出节点8的标识的哈希值后,通过查询哈希表,确定该哈希表中并没有存储有节点8对应的数据页在内存中的存储地址。也就是说,节点8对应的数据页并不在内存中。此时,需要从磁盘中读取磁盘块8中的内容,并将该磁盘块8中的内容写入到内存中新建的一个数据页中。也就是说,需要在内存中插入一个数据页。该插入操作的实现过程如下所述:
1)对哈希表加互斥锁。
2)根据节点8的标识对应的哈希值,从哈希表中确定该哈希值对 应的位置,并在该位置上存储节点8对应的数据页在内存中的存储地址。
3)释放哈希表上的互斥锁。
可以理解的是,在对内存中的数据进行访问或者是在内存中插入新的数据页时,需要对哈希表加锁,也就是说,需要在哈希表这样的粒度上进行互斥。由于哈希表是对整个内存进行管理的,对哈希表加锁,相当于给整个内存加了锁。此外,CPU是从内存中取数据,并不是直接从磁盘中取数据,若CPU访问的数据不在内存中,还需要将磁盘中相应的数据缓存到内存中。因此,当某个线程给哈希表加了互斥锁后,将导致其他线程无法访问内存,无法判断该线程访问的数据是否在内存中,进而无法从磁盘中取数据。也就是说,对哈希表加锁,相当于给整个数据库也加了锁。因此,内存是数据库逻辑计算的基础,内存的并发能力直接影响了数据库的吞吐量,以及系统性能。因此,在高并发场景下,给哈希表加锁的方式将导致内存访问成为性能瓶颈,从而使得系统性能较低。即使将哈希表拆分为多个部分,给哈希表的部分加锁,也不能从根本上解决计算机系统性能低的问题。
针对该问题,本公开实施例提供了一种数据访问方法,下面结合具体的实施例对该方法进行介绍。
图3为本公开实施例提供的数据访问方法流程图。该方法具体步骤如下:
S301、获取数据访问请求,所述数据访问请求包括待访问的目标数据的标识信息。
具体的,待访问的目标数据的标识信息具体可以是待访问的目标数据的主键值。
S302、根据待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历,确定所述数据结构中的第一节点和第二节点,其中,所述第一节点是所述第二节点的子节点,所述第一节点包括所述目标数据的标识信息。
在本实施例中,对于内存中已经缓存的数据页,可以在该数据页对应的节点中增加该数据页在内存中的存储地址。
为了将如上所述的节点所占用的磁盘块的地址与本公开实施例提 到的数据页在内存中的存储地址区分开,可以将如上所述的节点所占用的磁盘块的地址记为第一指针,将数据页在内存中的存储地址记为第二指针。也就是说,若B+Tree中某个节点对应的数据页缓存在内存中,则该节点即包括第一指针也包括第二指针。如果B+Tree中某个节点对应的数据页不在内存中,则该节点包括第一指针,不包括第二指针。
例如,内存中缓存有如图4所示的节点1、节点2、节点3、节点7、节点8、节点9分别对应的数据页。其中,节点1对应的数据页在内存中的存储地址记为Father_pointer_page1,节点2对应的数据页在内存中的存储地址记为Child_pointer_page2,节点3对应的数据页在内存中的存储地址记为Child_pointer_page3,节点7对应的数据页在内存中的存储地址记为Child_pointer_page7,节点8对应的数据页在内存中的存储地址记为Child_pointer_page8,节点9对应的数据页在内存中的存储地址记为Child_pointer_page9。
以p2和Child_pointer_page2为例,在节点1中,p2和Child_pointer_page2之间可以存在对应关系。具体的,p2是第一指针,Child_pointer_page2是第二指针。p2表示节点2占用的磁盘块2的位置,Child_pointer_page2表示节点2对应的数据页在内存中的存储地址。
由于节点1是节点2和节点3的父节点,所以在节点1中可以记录有Child_pointer_page2和Child_pointer_page3。指针p3和Child_pointer_page3之间可以存在对应关系。
由于节点3是节点7、节点8和节点9的父节点,所以在节点3中可以记录有Child_pointer_page7、Child_pointer_page8、Child_pointer_page9。指针p7和Child_pointer_page7之间可以存在对应关系,指针p8和Child_pointer_page8之间可以存在对应关系,指针p9和Child_pointer_page9之间可以存在对应关系。也就是说,父节点中可以记录子节点对应的数据页在内存中的存储地址。另外,子节点也可以记录其父节点对应的数据页在内存中的存储地址。
例如节点7、节点8和节点9中分别记录有Father_pointer_page3,Father_pointer_page3表示节点3对应的数据页在内存中的存储地址。也就是说,节点7、节点8和节点9中的Father_pointer_page3与节点1 中记录的Child_pointer_page3相同。
同理,节点2和节点3中分别记录有节点1对应的数据页在内存中的存储地址即Father_pointer_page1。
也就是说,如图4所示的B+Tree不仅是数据库对应的数据结构,同时,该B+Tree还可用于管理内存,即在本实施例中,不需要采用哈希表的方式对内存进行管理。
在一实施方式中,根据待访问的目标数据的主键值,可以对如图4所示的B+Tree进行遍历。
在一实施方式中,所述数据结构为树状的数据结构;所述对数据库对应的数据结构进行遍历,包括:从根节点开始对数据库对应的数据结构进行遍历。
例如,节点1为根节点(root node),目标数据的主键值为29,如图4所示,从根节点开始对B+Tree进行遍历。具体的,从根节点开始一直访问到叶子节点。具体遍历过程包括如下步骤:
1)对根节点加共享锁。
2)读取根节点中的内容,比较主键值29和主键值28后,选取指针p3,并读取Child_pointer_page3。
3)释放根节点的共享锁。
4)对节点3加共享锁。
5)根据Child_pointer_page3,从内存中读取节点3对应的数据页,比较主键值29和区间(36,79),选取指针p7,并读取Child_pointer_page7。
6)释放节点3的共享锁。
7)对节点7加共享锁。
8)根据Child_pointer_page7,从内存中读取节点7对应的数据页,在该数据页中找到关键字29。
9)释放节点7的共享锁。
通过对如图4所示的B+Tree进行遍历,可以确定出节点7和节点3,其中,节点7是节点3的子节点,节点3是节点7的父节点。节点7包括目标数据的主键值29。此处,可以将包括目标数据的主键值29的节点7记为第一节点,将节点3记为第二节点。
S303、若所述第二节点包括所述第一节点对应的第一数据页在内 存中的存储地址,则对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁。
如图4所示,由于节点3包括节点7对应的数据页在内存中的存储地址即Child_pointer_page7,说明节点7对应的数据页在内存中。因此,可以直接对内存中存储的节点7对应的数据页进行访问。具体的,当计算机系统中的某个线程需要对内存中存储的节点7对应的数据页进行访问时,该线程可以先对节点3加锁,然后根据节点7对应的数据页在内存中的存储地址即Child_pointer_page7,找到内存中存储的节点7对应的数据页,并对节点7对应的数据页进行访问,访问之后释放节点3上的锁。对节点7对应的数据页进行访问时,具体可以对该数据页中的全部记录或部分记录进行删除、修改、写入、读取等操作。
在一实施方式中,若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则所述第一节点还包括所述第二节点对应的第二数据页在内存中的存储地址。
如图4所示,节点7是节点3的子节点,节点3是节点7的父节点。节点7记为第一节点,节点3记为第二节点。当节点3包括节点7对应的数据页在内存中的存储地址即Child_pointer_page7时,节点7也可以包括节点3对应的数据页在内存中的存储地址即Father_pointer_page3。具体的,可以将第一节点对应的数据页记为第一数据页,将第二节点对应的数据页记为第二数据页。
本公开实施例通过待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历,从该数据结构中确定出具有父子关系的第一节点和第二节点,其中,第一节点是第二节点的子节点,第一节点包括目标数据的标识信息。由于该数据结构不仅是数据库中数据的组织形式,同时该数据结构还用于管理内存,也就是说在本实施例中不需要专门设立哈希表对内存进行管理。另外,在本实施例中,当子节点对应的数据页已经缓存在内存时,可以在该子节点的父节点中记录该子节点对应的数据页在内存中的存储地址。如此,当某个线程需要访问内存中某个子节点对应的数据页时,只需对该子节点的父节点进行加锁即可,由于一个父节点下的子节点个数是有限的几个子节点,因此, 对一个父节点进行加锁,只是避免其他线程对内存中该有限个子节点对应的数据页进行访问,不会导致其他线程无法对内存中所有的数据页或大部分的数据页进行访问,从而在内存粒度上实现了无锁化,由于只是在数据页的粒度上加锁,因此大大减小了加锁的数据粒度,从而在高并发场景下,避免内存访问成为性能瓶颈,保证了数据库的吞吐量,从而有效提高了计算机系统性能。
在上述实施例的基础上,对所述第二节点加锁,包括:对所述第二节点包括的所述第一数据页在内存中的存储地址加锁。
如图4所示,当某个线程需要对节点7对应的数据页进行访问时,该线程可以只对节点3中的部分内容加锁。
例如,节点3包括Child_pointer_page7、Child_pointer_page8和Child_pointer_page9,因此,在对节点3进行加锁时,可以只对Child_pointer_page7、Child_pointer_page8和Child_pointer_page9加锁,或者只对Child_pointer_page7加锁。
本实施例通过对第二节点包括的第一数据页在内存中的存储地址加锁,可以减小加锁的数据粒度,从而提高了计算机性能。
在一实施方式中,对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括如下几种可能的情况:
一种可能的情况是:对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,删除所述内存中存储的所述第一数据页或删除所述第一数据页中的部分记录后,释放所述第二节点上的互斥锁。
例如,某个线程需要对内存中节点7对应的数据页进行删除操作或需要对内存中节点7对应的数据页中的部分记录进行删除操作时,该删除操作的实现过程如下所述:
1)对节点3加互斥锁。
2)根据节点7对应的数据页在内存中的存储地址,在内存中找到节点7对应的数据页,删除该节点7对应的数据页或删除节点7对应 的数据页中的部分记录。如果是删除该节点7对应的数据页,还可以删除节点3中的Child_pointer_page7,或者将节点3中的Child_pointer_page7赋值为NULL。
3)释放节点3上的互斥锁。
可以理解的是,节点3是非叶子节点(no-leaf node)、节点7是叶子节点(leaf node),由于节点3和节点7是相互关联的,因此,节点7和节点3是相互关联的叶子节点和非叶子节点。由于从非叶子节点可以查询到叶子节点。因此,在内存中,非叶子节点对应的数据页的访问频率要比叶子节点对应的数据页的访问频率高。因此,在对内存中的数据页进行删除时,可以优先删除叶子节点对应的数据页。
在一实施方式中,若删除所述内存中存储的所述第一数据页,则释放所述第二节点上的互斥锁之后,所述方法还包括:删除所述第一节点包括的所述第二节点对应的第二数据页在内存中的存储地址。
例如,某线程将内存中的节点7对应的数据页删除后,该线程还可以删除该节点7包括的节点3对应的数据页在内存中的存储地址即Father_pointer_page3,或者将Father_pointer_page3赋值为NULL。该过程具体如下所述:
1)对节点7加互斥锁。
2)删除节点7中包括的节点3对应的数据页在内存中的存储地址即Father_pointer_page3。
3)释放节点7上的互斥锁。
可以理解的是,由于节点对应的数据页是缓存在内存中的,因此,当某个节点对应的数据页被删除时,并不意味着这个节点从数据结构中被删除,而只是从该节点的父节点中删除该节点对应的数据页在内存中的存储地址,以及删除该节点包括的该父节点对应的数据页在内存中的存储地址。该节点和其父节点之间的父子关系在该数据结构中还是存在的。
再一种可能的情况是:对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:对所述第二节点加共享锁,并根据所述第一数据页在内存中的存储地址,从所述内存中读取所述 第一数据页或读取所述第一数据页中的部分记录后,释放所述第二节点上的共享锁。
例如,某个线程需要读取内存中节点7对应的数据页或该数据页中的部分记录,该读取操作的实现过程如下所述:
1)对节点3加共享锁。
2)根据节点3中的Child_pointer_page7,从内存中读取节点7对应的数据页或从内存中读取该数据页中的部分记录。
3)释放节点3上的共享锁。
又一种可能的情况是:对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页中的部分记录或全部记录进行修改后,释放所述第二节点上的互斥锁。
例如,某个线程需要修改内存中节点7对应的数据页或该数据页中的部分记录,该修改操作的实现过程如下所述:
1)对节点3加互斥锁。
2)根据节点3中的Child_pointer_page7,在内存中找到节点7对应的数据页,对该节点7对应的数据页中的全部记录或部分记录进行修改。
3)释放节点3上的互斥锁。
另一种可能的情况是:对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,在所述内存中存储的所述第一数据页中写入新的记录后,释放所述第二节点上的互斥锁。
例如,某个线程需要在内存中节点7对应的数据页中写入新的记录,该写入新记录操作的实现过程如下所述:
1)对节点3加互斥锁。
2)根据节点3中的Child_pointer_page7,在内存中找到节点7对应的数据页,在该节点7对应的数据页中写入新的记录。
3)释放节点3上的互斥锁。
本实施例通过对父节点加锁,根据父节点中记录的子节点的数据页在内存中的存储地址,对该数据页进行访问,例如,读取该数据页中的全部记录或部分记录、删除该数据页中的全部记录或部分记录、修改该数据页中的全部记录或部分记录、在该数据页中写入新的记录等操作,相应的访问操作完成后再释放父节点上的锁。相比于给哈希表加锁而锁定整个内存的方式,本实施例给父节点加锁的方式大大减小了加锁的数据粒度,从而在高并发场景下,避免内存访问成为性能瓶颈,保证了数据库的吞吐量,从而有效提高了计算机系统性能。
在一实施方式中,所述方法还包括:若所述第二节点不包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加互斥锁,将所述第一节点对应的第一数据页缓存到所述内存后,在所述第二节点中写入所述第一数据页在内存中的存储地址,并释放所述第二节点上的互斥锁。
如图4所示,目标数据的主键值为29,根据目标数据的主键值29从B+Tree的根节点对B+Tree进行遍历后,确定出节点7和节点3,节点7记为第一节点,节点3记为第二节点。但是,节点3中包括Child_pointer_page8和Child_pointer_page9,并不包括Child_pointer_page7,说明节点7对应的数据页并不在内存中,此时需要从磁盘中读取节点7占用的磁盘块7中的内容,并将该内容放入内存中新建的一个数据页中,即需要在内存中插入一个新的数据页,该数据页中的内容是节点7占用的磁盘块7中的内容。该插入操作的实现过程如下所述:
1)对节点3加互斥锁。
2)在内存中插入一个新的数据页,该数据页中的内容是节点7占用的磁盘块7中的内容。内存中新插入的数据页即为节点7对应的数据页。在节点3中增加节点7对应的数据页在内存中的存储地址,即在节点3中增加Child_pointer_page7。
3)释放节点3上的互斥锁。
在一实施方式中,释放所述第二节点上的互斥锁之后,所述方法还包括:在所述第一节点中写入所述第二节点对应的第二数据页在内 存中的存储地址。
例如,在节点3中增加Child_pointer_page7后,还可以在节点7中增加Father_pointer_page3。具体实现过程如下所述:
1)对节点3加互斥锁。
2)在内存中插入一个新的数据页,该数据页中的内容是节点7占用的磁盘块7中的内容。内存中新插入的数据页即为节点7对应的数据页。在节点3中增加节点7对应的数据页在内存中的存储地址,即在节点3中增加Child_pointer_page7。
3)释放节点3上的互斥锁。
4)对节点7加互斥锁。
5)在节点7中增加Father_pointer_page3。
6)释放节点7上的互斥锁。
本实施例通过在父节点中增加子节点对应的数据页在内存中的存储地址,在子节点中增加父节点对应的数据页在内存中的存储地址,可以实现对B+Tree的快速遍历,从而实现对内存中数据页的快速访问。
图5为本公开实施例提供的数据访问装置的结构示意图。本公开实施例提供的数据访问装置可以执行数据访问方法实施例提供的处理流程,如图5所示,数据访问装置50包括:
获取模块51,设置为获取数据访问请求,所述数据访问请求包括待访问的目标数据的标识信息;
遍历模块52,设置为根据待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历;
确定模块53,设置为确定所述数据结构中的第一节点和第二节点,其中,所述第一节点是所述第二节点的子节点,所述第一节点包括所述目标数据的标识信息;
访问模块54,设置为若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁。
在一实施方式中,若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则所述第一节点还包括所述第二节点对 应的第二数据页在内存中的存储地址。
在一实施方式中,所述数据结构为树状的数据结构;遍历模块52具体设置为:从根节点开始对数据库对应的数据结构进行遍历。
在一实施方式中,访问模块54具体设置为:对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,删除所述内存中存储的所述第一数据页或删除所述第一数据页中的部分记录后,释放所述第二节点上的互斥锁。
在一实施方式中,访问模块54在删除所述内存中存储的所述第一数据页,释放所述第二节点上的互斥锁之后,还设置为:删除所述第一节点包括的所述第二节点对应的第二数据页在内存中的存储地址。
在一实施方式中,访问模块54具体设置为:
对所述第二节点加共享锁,并根据所述第一数据页在内存中的存储地址,从所述内存中读取所述第一数据页或读取所述第一数据页中的部分记录后,释放所述第二节点上的共享锁。
在一实施方式中,访问模块54具体设置为:
对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页中的部分记录或全部记录进行修改后,释放所述第二节点上的互斥锁。
在一实施方式中,访问模块54具体设置为:
对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,在所述内存中存储的所述第一数据页中写入新的记录后,释放所述第二节点上的互斥锁。
在一实施方式中,访问模块54对所述第二节点加锁时,具体设置为:对所述第二节点包括的所述第一数据页在内存中的存储地址加锁。
在一实施方式中,访问模块54还设置为:若所述第二节点不包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加互斥锁,将所述第一节点对应的第一数据页缓存到所述内存后,在所述第二节点中写入所述第一数据页在内存中的存储地址,并释放所述第二节点上的互斥锁。
在一实施方式中,访问模块54释放所述第二节点上的互斥锁之后,还设置为:在所述第一节点中写入所述第二节点对应的第二数据页在 内存中的存储地址。
图5所示实施例的数据访问装置可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图6为本公开实施例提供的数据访问设备的结构示意图。本公开实施例提供的数据访问设备可以执行数据访问方法实施例提供的处理流程,如图6所示,数据访问设备60包括:存储器61、处理器62、计算机程序和通讯接口63;其中,计算机程序存储在存储器61中,并被配置为由处理器62执行如上所述的数据访问方法。
另外,本公开实施例还提供一种计算机可读存储介质,其中,该计算机可读存储介质可存储有程序,该程序执行时可实现上述实施例提供的数据访问方法的各实现方式中的部分或全部步骤。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。
工业实用性
本公开实施例提供的数据访问方法,可有效减小加锁的数据粒度,从而在高并发场景下,避免内存访问成为性能瓶颈,保证数据库的吞吐量,从而有效提高计算机系统性能,具有很强的工业实用性。

Claims (14)

  1. 一种数据访问方法,所述方法包括:
    获取数据访问请求,所述数据访问请求包括待访问的目标数据的标识信息;
    根据待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历,确定所述数据结构中的第一节点和第二节点,其中,所述第一节点是所述第二节点的子节点,所述第一节点包括所述目标数据的标识信息;
    若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁。
  2. 根据权利要求1所述的方法,其中,若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则所述第一节点还包括所述第二节点对应的第二数据页在内存中的存储地址。
  3. 根据权利要求1或2所述的方法,其中,所述数据结构为树状的数据结构;
    所述对数据库对应的数据结构进行遍历,包括:
    从根节点开始对数据库对应的数据结构进行遍历。
  4. 根据权利要求1或2所述的方法,其中,对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:
    对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,删除所述内存中存储的所述第一数据页或删除所述第一数据页中的部分记录后,释放所述第二节点上的互斥锁。
  5. 根据权利要求4所述的方法,其中,若删除所述内存中存储的所述第一数据页,则释放所述第二节点上的互斥锁之后,所述方法还 包括:
    删除所述第一节点包括的所述第二节点对应的第二数据页在内存中的存储地址。
  6. 根据权利要求1或2所述的方法,其中,对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:
    对所述第二节点加共享锁,并根据所述第一数据页在内存中的存储地址,从所述内存中读取所述第一数据页或读取所述第一数据页中的部分记录后,释放所述第二节点上的共享锁。
  7. 根据权利要求1或2所述的方法,其中,对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:
    对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页中的部分记录或全部记录进行修改后,释放所述第二节点上的互斥锁。
  8. 根据权利要求1或2所述的方法,其中,对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁,包括:
    对所述第二节点加互斥锁,并根据所述第一数据页在内存中的存储地址,在所述内存中存储的所述第一数据页中写入新的记录后,释放所述第二节点上的互斥锁。
  9. 根据权利要求1-8任一项所述的方法,其中,对所述第二节点加锁,包括:
    对所述第二节点包括的所述第一数据页在内存中的存储地址加锁。
  10. 根据权利要求1-9任一项所述的方法,其中,所述方法还包括:
    若所述第二节点不包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加互斥锁,将所述第一节点对应的第一数据页缓存到所述内存后,在所述第二节点中写入所述第一数据页 在内存中的存储地址,并释放所述第二节点上的互斥锁。
  11. 根据权利要求10所述的方法,其中,释放所述第二节点上的互斥锁之后,所述方法还包括:
    在所述第一节点中写入所述第二节点对应的第二数据页在内存中的存储地址。
  12. 一种数据访问装置,包括:
    获取模块,设置为获取数据访问请求,所述数据访问请求包括待访问的目标数据的标识信息;
    遍历模块,设置为根据待访问的目标数据的标识信息,对数据库对应的数据结构进行遍历;
    确定模块,设置为确定所述数据结构中的第一节点和第二节点,其中,所述第一节点是所述第二节点的子节点,所述第一节点包括所述目标数据的标识信息;
    访问模块,设置为若所述第二节点包括所述第一节点对应的第一数据页在内存中的存储地址,则对所述第二节点加锁,并根据所述第一数据页在内存中的存储地址,对所述内存中存储的所述第一数据页进行访问后,释放所述第二节点上的锁。
  13. 一种数据访问设备,包括:
    存储器;
    处理器;以及
    计算机程序;
    其中,所述计算机程序存储在所述存储器中,并被配置为由所述处理器执行以实现如权利要求1-11中任一所述的方法。
  14. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-11中任一项所述的方法。
PCT/CN2021/102471 2020-09-29 2021-06-25 一种数据访问方法、装置、设备及计算机可读存储介质 WO2022068289A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011049612.1A CN114328500A (zh) 2020-09-29 2020-09-29 一种数据访问方法、装置、设备及计算机可读存储介质
CN202011049612.1 2020-09-29

Publications (1)

Publication Number Publication Date
WO2022068289A1 true WO2022068289A1 (zh) 2022-04-07

Family

ID=80949691

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/102471 WO2022068289A1 (zh) 2020-09-29 2021-06-25 一种数据访问方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN114328500A (zh)
WO (1) WO2022068289A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024046130A1 (zh) * 2022-08-31 2024-03-07 中兴通讯股份有限公司 任务处理方法、电子设备以及存储介质

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100082664A1 (en) * 2008-10-01 2010-04-01 International Business Machines Corporation Method for searching a tree structure
US20110238949A1 (en) * 2010-03-29 2011-09-29 International Business Machines Corporation Distributed Administration Of A Lock For An Operational Group Of Compute Nodes In A Hierarchical Tree Structured Network
CN103780490A (zh) * 2012-10-17 2014-05-07 中兴通讯股份有限公司 一种更新路由查找树的方法及装置
US20140310317A1 (en) * 2013-04-11 2014-10-16 Apple Inc. Locking and traversal methods for ordered tree data structures
CN109407979A (zh) * 2018-09-27 2019-03-01 清华大学 多线程持久性b+树数据结构设计与实现方法
CN109582677A (zh) * 2018-12-03 2019-04-05 东北大学 基于孩子节点的多粒度分布式读写锁的r树索引优化方法
US20190163542A1 (en) * 2017-11-29 2019-05-30 Fujitsu Limited Lock control apparatus and lock control method
US20190294715A1 (en) * 2018-03-20 2019-09-26 Vmware, Inc. Proactive splitting and merging of nodes in a b e-tree
CN110990404A (zh) * 2019-11-27 2020-04-10 亚信科技(中国)有限公司 一种索引数据的处理方法、装置及电子设备
CN111198660A (zh) * 2019-12-26 2020-05-26 天津中科曙光存储科技有限公司 一种b+树遍历的方法及装置

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100082664A1 (en) * 2008-10-01 2010-04-01 International Business Machines Corporation Method for searching a tree structure
US20110238949A1 (en) * 2010-03-29 2011-09-29 International Business Machines Corporation Distributed Administration Of A Lock For An Operational Group Of Compute Nodes In A Hierarchical Tree Structured Network
CN103780490A (zh) * 2012-10-17 2014-05-07 中兴通讯股份有限公司 一种更新路由查找树的方法及装置
US20140310317A1 (en) * 2013-04-11 2014-10-16 Apple Inc. Locking and traversal methods for ordered tree data structures
US20190163542A1 (en) * 2017-11-29 2019-05-30 Fujitsu Limited Lock control apparatus and lock control method
US20190294715A1 (en) * 2018-03-20 2019-09-26 Vmware, Inc. Proactive splitting and merging of nodes in a b e-tree
CN109407979A (zh) * 2018-09-27 2019-03-01 清华大学 多线程持久性b+树数据结构设计与实现方法
CN109582677A (zh) * 2018-12-03 2019-04-05 东北大学 基于孩子节点的多粒度分布式读写锁的r树索引优化方法
CN110990404A (zh) * 2019-11-27 2020-04-10 亚信科技(中国)有限公司 一种索引数据的处理方法、装置及电子设备
CN111198660A (zh) * 2019-12-26 2020-05-26 天津中科曙光存储科技有限公司 一种b+树遍历的方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024046130A1 (zh) * 2022-08-31 2024-03-07 中兴通讯股份有限公司 任务处理方法、电子设备以及存储介质

Also Published As

Publication number Publication date
CN114328500A (zh) 2022-04-12

Similar Documents

Publication Publication Date Title
CN109213772B (zh) 数据存储方法及NVMe存储系统
US9672235B2 (en) Method and system for dynamically partitioning very large database indices on write-once tables
US9454560B2 (en) Cache-conscious concurrency control scheme for database systems
US9256607B2 (en) Efficient file access in a large repository using a two-level cache
US7243088B2 (en) Database management system with efficient version control
US9171027B2 (en) Managing a multi-version database
US10754854B2 (en) Consistent query of local indexes
US9576038B1 (en) Consistent query of local indexes
US10509916B2 (en) Access control lists for high-performance naming service
CN103595797B (zh) 一种分布式存储系统中的缓存方法
CN109582677B (zh) 基于孩子节点的多粒度分布式读写锁的r树索引优化方法
WO2016119597A1 (zh) Oltp集群数据库中页面查询方法及数据处理节点
WO2023165374A1 (zh) 数据库操作方法、装置、设备及存储介质
US20020078047A1 (en) Method, system, and program for reverse index scanning
WO2022068289A1 (zh) 一种数据访问方法、装置、设备及计算机可读存储介质
US10558636B2 (en) Index page with latch-free access
Lomet Simple, robust and highly concurrent B-trees with node deletion
Yeon et al. Jellyfish: A fast skip list with mvcc
CN111611246B (zh) 一种基于持久性存储器优化b+树索引性能的方法和系统
US6571250B1 (en) Method and system for processing queries in a data processing system using index
JP2004505380A (ja) ネスト化データベースを実行するための方法、システム及びデータ構造
US10698877B2 (en) High-performance naming service using an optimistic-concurrency-control in-memory database
KR100507782B1 (ko) 데이터베이스 관리시스템 및 그 시스템에서 시스템테이블에 대한 동시성 제어 방법
CN117311645B (zh) 一种lsm存储元数据读放大的优化方法
US7809766B2 (en) Writable shared database objects

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21873951

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21873951

Country of ref document: EP

Kind code of ref document: A1