KR-20260067256-A - ELECTRONIC DEVICE AND NON-TRANSITORY COMPUTER READABLE STORAGE MEDIUM PERFORMING PREFETCHING FOR DATABASE
Abstract
An electronic device may include at least one processor and a memory for storing instructions. The instructions may cause the electronic device to prefetch data stored in at least one child node of the node according to the query by identifying a query to perform prefetching with respect to a table of a database, and based on the query, sequentially identifying information indicating the type of each node included in the table according to the order of levels regarding the table, and identifying a node storing information indicating the type defined during the sequential identification: bypassing the identification of the type of at least one child node of the node.
Inventors
- 우호빈
- 박종혁
- 이상원
- 전혜은
- 신윤호
- 이기성
Assignees
- 삼성전자주식회사
- 서울대학교산학협력단
Dates
- Publication Date
- 20260512
- Application Date
- 20241120
- Priority Date
- 20241105
Claims (20)
- In the electronic device (101), At least one processor (110) including a processing circuit; and It includes a memory (120) that stores instructions and includes one or more storage media, and When the above instructions are executed individually or collectively by the at least one processor (110): Identify the query to perform prefetching on the database table, and Based on the above query, information indicating the type of each node included in the above table is identified sequentially according to the order of levels regarding the above table, and Based on identifying a node storing information representing a defined type while performing the above sequential identification: Bypassing the identification of the type of at least one child node of the above node, and In order to read in advance the data stored in the at least one child node of the above node according to the above query, The above electronic device (101) causes, The information indicating the type of each of the above nodes is stored in each of the above nodes included in the table, and The information indicating the type of each of the above nodes is used to search for at least one node among the above nodes that stores data to be read in advance, Electronic device (101).
- In claim 1, When the above instructions are executed individually or collectively by the at least one processor (110): In the first time interval, according to the above query, data stored in the first child node included in the at least one child node is read in advance, and In the second time interval, according to the above query, data stored in the second child node included in the at least one child node is read in advance, At least a portion of the above second time interval is overlapped with at least a portion of the above first time interval, The above electronic device (101) causing, Electronic device (101).
- In claim 1, When the above instructions are executed individually or collectively by the at least one processor (110): Based on identifying the node storing the information representing the defined type while performing the above sequential identification: Obtaining location data representing the location of each of the at least one child node, stored in the node storing the information representing the type defined above, and Based on the above location data, identify the at least one child node, and To pre-read the data stored in the at least one child node identified based on the above location data, The above electronic device (101) causes, The operation of bypassing the identification of the type of the at least one child node is an operation of not identifying information indicating the type of the at least one child node in order to pre-read the data stored in the at least one child node using the location data. Electronic device (101).
- In claim 3, When the above instructions are executed individually or collectively by the at least one processor (110): Based on obtaining the location data stored in the node that stores the information representing the type defined above: Identifying the data stored in the at least one child node represented according to the above acquired location data as the first data, and Identifying the second data, excluding the data stored in the cache memory from the first data, as the data to be read in advance, To perform the prefetching by reading the second data, The above electronic device (101) causing, Electronic device (101).
- In claim 1, Each of the above nodes corresponds to a root node that has no parent node, an internal node, or a leaf node that has no child nodes, and The type of at least one child node mentioned above represents the leaf node, and The above information represents the defined type by indicating the internal node having the leaf node as the child node. Electronic device (101).
- In claim 5, When the above instructions are executed individually or collectively by the at least one processor (110): Based on performing a full scan related to the above table, the information indicating the type of each of the above nodes is identified sequentially according to the order of the above levels. The above electronic device (101) causes, The above full scan is performed to obtain data stored in all leaf nodes included in the table, Electronic device (101).
- In claim 6, When the above instructions are executed individually or collectively by the at least one processor (110): Identify the query to perform the full scan related to the above table, and Based on the above query, identify a value corresponding to the number of times the above full scan related to the table has been performed, and Based on identifying the value corresponding to the number of times the threshold value is exceeded, data related to performing the entire scan is read in advance, and Based on the identification of the value corresponding to the number of times falling below the threshold value, to refrain from reading the data in advance regarding the performance of the entire scan. The above electronic device (101) causing, Electronic device (101).
- In claim 1, The above information includes a value representing the type of each of the above nodes, and The above information is stored in the header of each of the above nodes, Electronic device (101).
- In claim 1, Each of the above nodes corresponds to a root node that has no parent node, an internal node, or a leaf node that has no child nodes, and Each of the above nodes has a level based on the hierarchical structure between the parent node and the child node, The order of the above levels is identified to determine the search order regarding each of the above nodes, and The above table has a tree structure in which the number of child nodes of the root node is two or more, the number of child nodes of each of the internal nodes is two or more, and all leaf nodes correspond to the same level. Electronic device (101).
- In the electronic device (101), At least one processor (110) including a processing circuit; and It includes a memory (120) that stores instructions and includes one or more storage media, and When the above instructions are executed individually or collectively by the at least one processor (110): Identify the query to perform a full scan related to the database tables, and Based on the above query, identify a value corresponding to the number of times the above full scan related to the table has been performed, and Based on identifying the value corresponding to the number of times the threshold value is exceeded, data related to performing the entire scan is read in advance, and Based on the identification of the value corresponding to the number of times falling below the threshold value, to refrain from reading the data in advance regarding the performance of the entire scan. The above electronic device (101) causing, Electronic device (101).
- In claim 10, The parameter indicating the above number is initialized when the database is loaded by the at least one processor (110). Electronic device (101).
- In claim 10, When the above instructions are executed individually or collectively by the at least one processor (110): To update the number under the condition that the above full scan related to the above table is performed, The above electronic device (101) causing, Electronic device (101).
- In claim 10, When the above instructions are executed individually or collectively by the at least one processor (110): Based on the above query, identify the size of the data related to performing the above full scan, and Based on identifying the value corresponding to the size exceeding the threshold size and the number of times exceeding the threshold value, to pre-read the data related to performing the entire scan. The above electronic device (101) causing, Electronic device (101).
- In claim 10, When the above instructions are executed individually or collectively by the at least one processor (110): In the first time interval, according to the above query, data stored in one of the nodes included in the table is read in advance, and In the second time interval, according to the above query, data stored in another of the nodes included in the above table is read in advance, and At least a portion of the above second time interval is overlapped with at least a portion of the above first time interval, The above electronic device (101) causing, Electronic device (101).
- In claim 10, When the above instructions are executed individually or collectively by the at least one processor (110): Identifying a bitmap stored in relation to the above table and indicating the location of each node included in the above table, and Based on identifying the value corresponding to the number of times the threshold value is exceeded, the data stored in the nodes identified according to the bitmap is read, and the read data is stored, thereby allowing the data to be read in advance. The above electronic device (101) causing, Electronic device (101).
- In claim 15, When the above instructions are executed individually or collectively by the at least one processor (110): Identifying the data represented according to the bitmap as the first data, Identifying the second data, excluding the data stored in the cache memory from the first data, as the data to be read in advance, To perform prefetching by reading the above second data, The above electronic device (101) causing, Electronic device (101).
- In claim 10, When the above instructions are executed individually or collectively by the at least one processor (110): Identify the query to perform prefetching in relation to the table of the above database, and Based on the above query, information indicating the type of each node included in the above table is identified sequentially according to the order of levels regarding the above table, and Based on identifying a node storing information representing a defined type while performing the above sequential identification: Bypassing the identification of the type of at least one child node of the above node, and In order to read in advance the data stored in the at least one child node of the above node according to the above query, The above electronic device (101) causes, The information indicating the type of each of the above nodes is stored in each of the above nodes included in the table, and The information indicating the type of each of the above nodes is used to search for at least one node among the above nodes that stores data to be read in advance, Electronic device (101).
- In a non-transient computer-readable storage medium storing one or more programs, the one or more programs, when executed by an electronic device (101): Identify the query to perform prefetching on the database table, and Based on the above query, information indicating the type of each node included in the above table is identified sequentially according to the order of levels regarding the above table, and Based on identifying a node storing information representing a defined type while performing the above sequential identification: Bypassing the identification of the type of at least one child node of the above node, and In order to read in advance the data stored in the at least one child node of the above node according to the above query, Includes instructions that cause the above electronic device (101), The information indicating the type of each of the above nodes is stored in each of the above nodes included in the table, and The information indicating the type of each of the above nodes is used to search for at least one node among the above nodes that stores data to be read in advance, Non-transient computer-readable storage media.
- In claim 18, When one or more of the above programs are executed by the electronic device (101): In the first time interval, according to the above query, data stored in the first child node included in the at least one child node is read in advance, and In the second time interval, according to the above query, data stored in the second child node included in the at least one child node is read in advance, At least a portion of the above second time interval is overlapped with at least a portion of the above first time interval, Instructions including those that cause the above electronic device (101), Non-transient computer-readable storage media.
- In claim 18, When one or more of the above programs are executed by the electronic device (101): Based on identifying the node storing the information representing the defined type while performing the above sequential identification: Obtaining location data representing the location of each of the at least one child node, stored in the node that stores information representing the type defined above, and Based on the above location data, identify the at least one child node, and To pre-read the data stored in the at least one child node identified based on the above location data, Includes instructions that cause the above electronic device (101), The operation of bypassing the identification of the type of the at least one child node is an operation of not identifying information indicating the type of the at least one child node in order to pre-read the data stored in the at least one child node using the location data. Non-transient computer-readable storage media.
Description
Electronic device and non-transitory computer-readable storage medium performing previewing for a database The following descriptions relate to an electronic device that performs a pre-read with respect to a database and a non-transient computer-readable storage medium. An electronic device can obtain said data from a database based on a query requesting data desired by a user. The electronic device can process said query by searching for said data within said database. For example, said database may have a hierarchical tree structure for nodes containing data. The information described above may be provided as related art for the purpose of aiding understanding of the present disclosure. No claim or determination is made as to whether any of the foregoing may be applied as prior art related to the present disclosure. Figure 1 is a schematic view of an exemplary electronic device. Figure 2 illustrates an example of a database system environment. Figure 3 illustrates an example of the structure of data included in a database. Figure 4 is a flowchart illustrating a method for determining whether to perform prefetching based on a query to perform a full scan. Figure 5 illustrates an example of a node structure to explain the types of nodes included in a database table. Figure 6 is a flowchart illustrating a method for performing prefetching on data stored in leaf nodes included in a table based on identifying a defined type. Figure 7 illustrates an example for explaining the operation of simultaneously receiving data from a database. Figure 8 illustrates another example of a database system environment. Figure 9 illustrates an example of a bitmap showing the locations of nodes included in a database table and the locations of nodes by table. FIG. 10 is a flowchart illustrating a method for performing prefetching on data stored in nodes included in a table using a bitmap. FIG. 11 is a block diagram of an electronic device in a network environment according to various embodiments. Figure 1 is a schematic view of an exemplary electronic device. Referring to FIG. 1, the electronic device (101) may include at least one processor (110) and a memory (120). The electronic device (101) may include at least a part of the electronic device (1101) of FIG. 11 or correspond to at least a part of the electronic device (1101) of FIG. 11. At least one processor (110) may include a processing circuit. At least one processor (110) may include a single processor or multiple processors. At least one processor (110) may control the memory (120) and/or one or more components (not shown) of the electronic device (101). For example, at least one processor (110) may include at least a part of the processor (1120) of FIG. 11 or correspond to at least a part of the processor (1120) of FIG. 11. Memory (120) may store one or more programs configured to be executed individually and/or collectively by at least one processor (110). The one or more programs may include instructions. The instructions may cause an electronic device (101) to perform operations described with reference to FIGS. 2 through 10. Memory (120) may include one or more storage media. At least some of the one or more programs may be available to manage, control, and/or execute a database management system described below. For example, memory (120) may include at least a portion of the memory (1130) of FIG. 11 or correspond to at least a portion of the memory (1130) of FIG. 11. Figure 2 illustrates an example of a database system environment. Referring to FIG. 2, the database system environment (200) may include an application (210), a database (220), and a database management system (230) (DBMS). As an example without limitation, the application (210), the database (220), and the database management system (230) may communicate with each other using a structured query language (SQL) to process data. The electronic device (101) can generate a query requesting data desired by a user by using an application (210) controlled (or executed) (or processed) by at least one processor (110). By generating the query, the application (210) can identify the data obtained based on the database (220). For example, the application (210) may include at least a part of the application (1146) of FIG. 11 or correspond to at least a part of the application (1146) of FIG. 11. The application (210) may be stored in memory (120). The database (220) may include structured data. The structured data may be stored in memory (120). The structure of the data included in the database (220) is explained with reference to FIG. 3. Figure 3 illustrates an example of the structure of data included in a database. Referring to FIG. 3, a database (300) including a table (310), a table (320), and a table (330) is shown. The database (220) may include one or more tables. The table may be described as a set of data stored in the database (220). For example, the table may be described as a storage space consisting