Electronic device for performing prefetching in relation to database and non-transitory computer-readable storage medium
By implementing prefetching strategies in database systems that optimize full scan performance and reduce unnecessary data reads, the solution addresses inefficiencies in data retrieval, improving system efficiency and reducing operational load.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-09-09
- Publication Date
- 2026-05-15
AI Technical Summary
Existing database systems face inefficiencies in data retrieval due to unnecessary full scans, leading to increased load on data input/output operations and prolonged data acquisition times.
An electronic device and non-transient computer-readable storage medium implement prefetching strategies based on query analysis, selectively performing full scans and bypassing child node type identification to reduce unnecessary data reads, thereby optimizing data retrieval.
The solution reduces data acquisition time and mitigates the load on data input/output operations by selectively performing prefetching based on scan frequency and data size thresholds, enhancing overall system efficiency.
Smart Images

Figure KR2025014026_15052026_PF_FP_ABST
Abstract
Description
Electronic device and non-transient computer-readable storage medium that perform a preview read on a database
[0001] 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.
[0002] 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.
[0003] 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.
[0004] An electronic device is provided. The electronic device may include at least one processor comprising a processing circuit and a memory comprising one or more storage media for storing instructions. When the instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to identify a query to perform prefetching with respect to a table in a database. When the instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to sequentially identify information indicating the type of each node included in the table based on the query, according to the order of levels regarding the table. When the above instructions are executed individually or collectively by the at least one processor: based on identifying a node storing information representing a type defined during the sequential identification, the electronic device may bypass identifying the type of at least one child node of the node and pre-read data stored in the at least one child node of the node according to the query. The information representing the type of each of the nodes may be stored in each of the nodes included in the table. The information representing the type of each of the nodes may be used to search for at least one node among the nodes that stores the data to be pre-read.
[0005] An electronic device is provided. The electronic device may include at least one processor comprising a processing circuit and a memory comprising one or more storage media for storing instructions. When the instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to identify a query to perform a full scan related to a table in a database. When the instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to identify a value corresponding to the number of times the full scan related to the table has been performed based on the query. When the instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to pre-read data related to performing the full scan based on the identification of the value corresponding to the number of times exceeding a threshold value. When the above instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to refrain from reading the data related to performing the entire scan based on the identification of the value corresponding to the number of times falling below the threshold value.
[0006] A non-transient computer-readable storage medium is provided. The non-transient computer-readable storage medium may store one or more programs. The one or more programs may include instructions that cause the electronic device to identify a query to perform prefetching with respect to a table of a database when executed by the electronic device. The one or more programs may include instructions that cause the electronic device to sequentially identify information indicating the type of each node included in the table based on the query, according to the order of levels regarding the table. The one or more programs may include instructions that cause the electronic device to bypass identifying the type of at least one child node of the node based on identifying a node storing information indicating the type defined during the sequential identification, and to prefetch data stored in the at least one child node of the node according to the query. The information indicating the type of each of the above nodes may be stored in each of the above nodes included in the table. The information indicating the type of each of the above nodes may be used to search for at least one node among the nodes that stores data to be read in advance.
[0007] A non-transient computer-readable storage medium is provided. The non-transient computer-readable storage medium may store one or more programs. The one or more programs may include instructions that cause the electronic device to identify a query to perform a full scan related to a table in a database when executed by the electronic device. The one or more programs may include instructions that cause the electronic device to identify a value corresponding to the number of times the full scan related to the table has been performed based on the query when executed by the electronic device. The one or more programs may include instructions that cause the electronic device to pre-read data related to performing the full scan based on the identification of the value corresponding to the number of times the full scan related to the table has been performed when executed by the electronic device. The above one or more programs may include instructions that cause the electronic device to refrain from pre-reading the data related to performing the entire scan, based on the identification of the value corresponding to the number of times that fall below the threshold value when executed by the electronic device.
[0008] Figure 1 is a schematic view of an exemplary electronic device.
[0009] Figure 2 illustrates an example of a database system environment.
[0010] Figure 3 illustrates an example of the structure of data included in a database.
[0011] Figure 4 is a flowchart illustrating a method for determining whether to perform prefetching based on a query to perform a full scan.
[0012] Figure 5 illustrates an example of a node structure to explain the types of nodes included in a database table.
[0013] 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.
[0014] Figure 7 illustrates an example for explaining the operation of simultaneously receiving data from a database.
[0015] Figure 8 illustrates another example of a database system environment.
[0016] 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.
[0017] FIG. 10 is a flowchart illustrating a method for performing prefetching on data stored in nodes included in a table using a bitmap.
[0018] FIG. 11 is a block diagram of an electronic device in a network environment according to various embodiments.
[0019] Figure 1 is a schematic view of an exemplary electronic device.
[0020] 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.
[0021] 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.
[0022] 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.
[0023] Figure 2 illustrates an example of a database system environment.
[0024] 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.
[0025] 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).
[0026] The database (220) may include structured data. The structured data may be stored in memory (120).
[0027] The structure of the data included in the database (220) is explained with reference to FIG. 3.
[0028] Figure 3 illustrates an example of the structure of data included in a database.
[0029] Referring to FIG. 3, a database (300) including a table (310), a table (320), and a table (330) is shown.
[0030] 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 of rows and columns in the database (220). For example, the database (300) may include the table (310), the table (320), and the table (330) as the one or more tables.
[0031] Each of the above one or more tables may include nodes. A node may be described as a basic unit constituting the table. For example, each of the nodes may store data having a defined size (e.g., pages). For example, a table (310) may include nodes (310_1), (310_2), (310_3), (310_4), (310_5), (310_6), (310_7), (310_8), and (310_9). For example, a table (320) may include nodes (320_1), (320_2), (320_3), (320_4), (320_5), (320_6), (320_7), (320_8), and (320_9). For example, the table (330) may include nodes (330_1), (330_2), (330_3), (330_4), (330_5), (330_6), (330_7), (330_8), and (330_9).
[0032] Each of the above one or more tables may have a tree structure in which the nodes are structured in a tree form. Each of the above one or more tables may have a tree structure in which the nodes correspond to a root node, an internal node, or a leaf node. For example, the nodes included in table (310), the nodes included in table (320), and the nodes included in table (330) may correspond to the root node, the internal node, or the leaf node.
[0033] The above root node can be described as a top-level node that does not have a parent node. The above parent node can be described as a node directly connected above any one of the nodes. For example, nodes (310_1), (320_1), and (330_1) can each correspond to the above root node.
[0034] The above internal node may be described as a node having the above parent node and child node. The above child node may be described as a node directly connected to the lower part of any one node. For example, each of nodes (310_2), (310_3), (320_2), (320_3), (330_2), and (330_3) may correspond to the above internal node.
[0035] The above leaf node may be described as the lowest node that does not have the above child node. For example, nodes (310_4), (310_5), (310_6), (310_7), (310_8), (310_9), (320_4), (320_5), (320_6), (320_7), (320_8), (320_9), (330_4), (330_5), (330_6), (330_7), (330_8), and (330_9) may each correspond to the above leaf node.
[0036] The above tree structure may correspond to a B-tree structure in which the number of child nodes of the root node is two or more, the number of child nodes of the internal nodes is two or more, and all leaf nodes correspond to the same level. The level may be described as the sum of the number of edges connecting from the root node to any one node. For example, each node included in the table may have a level based on the hierarchical structure between the parent node and the child node. For example, the order of the levels may be identified to determine the search order for each of the nodes included in the table. For example, each of the nodes (310_1), (320_1), and (330_1) may correspond to level 0 since they correspond to the root node. For example, each of nodes (310_2), (310_3), (320_2), (320_3), (330_2), and (330_3) can correspond to level 1 because the sum of the number of edges connected from the root node is '1'. For example, each of nodes (310_4), (310_5), (310_6), (310_7), (310_8), (310_9), (320_4), (320_5), (320_6), (320_7), (320_8), (320_9), (330_4), (330_5), (330_6), (330_7), (330_8), and (330_9) can correspond to Level 2 because the sum of the number of edges connected from the root node corresponds to '2'. However, the present disclosure is not limited thereto. For example, the present disclosure may also be applicable to a binary tree structure in which the number of child nodes for a single parent node is '1' or more and '2' or less.
[0037] The parent node may store location data indicating the location of the child node. For example, node (310_1) may include location data indicating the location of node (310_2) and node (310_3), respectively. Node (310_2) may include location data indicating the location of node (310_4), node (310_5), and node (310_6), respectively. Node (310_3) may include location data indicating the location of node (310_7), node (310_8), and node (310_9), respectively. For example, node (320_1) may include location data indicating the location of node (320_2) and node (320_3), respectively. Node (320_2) may include location data indicating the location of node (320_4), node (320_5), and node (320_6), respectively. Node (320_3) may include location data indicating the location of each of Node (320_7), Node (320_8), and Node (320_9). For example, Node (330_1) may include location data indicating the location of each of Node (330_2) and Node (330_3). Node (330_2) may include location data indicating the location of each of Node (330_4), Node (330_5), and Node (330_6). Node (330_3) may include location data indicating the location of each of Node (330_7), Node (330_8), and Node (330_9).
[0038] Each of the leaf nodes can store data to be read according to a query. For example, each of the nodes (310_4), (310_5), (310_6), (310_7), (310_8), (310_9), (320_4), (320_5), (320_6), (320_7), (320_8), (320_9), (330_4), (330_5), (330_6), (330_7), (330_8), and (330_9) can store data to be read according to the query.
[0039] Referring again to FIG. 2, the database management system (230) may include a query planner (231), a query executor (232), a cache memory (233), and a prefetching manager (240). The database management system (230) may store, retrieve, modify, and / or delete data contained in the database (220). For example, the database management system (230) may be managed, controlled, and / or executed by at least one processor (110).
[0040] The electronic device (101) can obtain data requested according to a query from a database (220) and / or a cache memory (233) based on a query generated by an application (210) using a database management system (230). For example, the electronic device (101) can identify whether the data requested according to the query is stored in the cache memory (233) based on the query generated by the application (210). Based on identifying that the data requested according to the query is stored in the cache memory (233), the electronic device (101) can provide the data stored in the cache memory (233) to the application (210). Based on identifying that the data requested according to the query is not stored in the cache memory (233), the electronic device (101) can provide the data stored in the table of the database (220) to the application (210) by searching for data included in the table of the database (220).
[0041] The query planner (231) can generate a query plan regarding the execution method of a query generated in the application (210). The electronic device (101) can use the query planner (231) to identify a query to perform a full scan related to a table in the database (220). The full scan can be described as an operation in which the electronic device (110) sequentially searches the nodes included in the table in the database (220) according to the order of levels related to the table.
[0042] The query executor (232) can perform the operation of processing the query based on the query plan generated by the query planner (231). The electronic device (101) can perform the full scan related to the table of the database (220) using the query executor (232).
[0043] For example, referring to FIG. 3, the electronic device (101) can identify location data of a root node (310_1) representing the location of each internal node (310_2) and internal node (310_3) when entering the full scan. Based on identifying the location data of the root node (310_1) representing the location of the internal node (310_2), the electronic device (101) can identify location data of the internal node (310_2) representing the location of each leaf node (310_4), leaf node (310_5), and leaf node (310_6). The electronic device (101) can read data stored in the leaf nodes (310_4), leaf nodes (310_5), and leaf nodes (310_6) by sequentially searching the leaf nodes (310_4), leaf nodes (310_5), and leaf nodes (310_6) based on identifying the location data of the internal node (310_2). The electronic device (101) can identify the location data of the internal node (310_3) representing the location of the leaf nodes (310_7), leaf nodes (310_8), and leaf nodes (310_9), respectively, based on identifying the location data of the root node (310_1) representing the location of the internal node (310_3). The electronic device (101) can read data stored in the leaf node (310_7), leaf node (310_8), and leaf node (310_9) by sequentially searching the leaf node (310_7), leaf node (310_8), and leaf node (310_9) based on identifying the location data of the internal node (310_3).
[0044] Referring again to FIG. 2, the prefetching manager (240) may include a prefetch checker (241) and a prefetcher (242).
[0045] The electronic device (101) can control a prefetching operation using a prefetching manager (240) when the query to perform the full scan related to the table of the database (220) is identified. The prefetching operation can be described as an operation of reading data included in the table of the database (220) and storing the read data in a cache memory (233) when the query to perform the full scan is identified. For example, the electronic device (101) can reduce the time required to acquire data according to the query by performing the prefetching operation.
[0046] The electronic device (101) can identify whether to perform prefetching related to the table of the database (220) by using a prefetch checker (241) based on identifying the query to perform the full scan related to the table of the database (220). For example, the electronic device (101) can set the table of the database (220) to perform the full scan as the target table for prefetching if the table of the database (220) to perform the full scan satisfies defined conditions (e.g., conditions regarding the number of times the full scan has been performed and conditions regarding the size of the data related to performing the full scan). For example, if prefetching is performed on a table that does not satisfy the defined conditions related to the full scan, the load on data input / output operations according to the query increases; therefore, the electronic device (101) can set the target table for prefetching to selectively perform the prefetching operation.
[0047] For example, the prefetch checker (241) may receive identification information for the query to perform the full scan from the query planner (231). Based on the identification information, the prefetch checker (241) may identify the target table for prefetching by identifying whether the table in the database (220) to perform the full scan satisfies the defined conditions.
[0048] A specific operation method for determining whether to perform prefetching based on a query to perform a full scan of the electronic device (101) is described with reference to FIG. 4.
[0049] Figure 4 is a flowchart illustrating a method for determining whether to perform prefetching based on a query to perform a full scan.
[0050] Referring to FIG. 4, in operation 401, at least one processor (110) can identify a query to perform a full scan related to a table of the database (220). For example, at least one processor (110) can identify the query requesting data desired by a user from an application (210). At least one processor (110) can identify the table to perform the full scan among a plurality of tables included in the database (220) based on the query plan generated by the query planner (231). As described above, the full scan can be described as an operation in which nodes included in the table of the database (220) are searched sequentially according to the order of levels related to the table.
[0051] In operation 402, at least one processor (110) can identify a value corresponding to the number of times (N) the full scan has been performed in relation to the table to be scanned, based on the query to be scanned. ('N' is an integer greater than or equal to '0'.) For example, the number of times (N) the full scan has been performed can be identified per table included in the database (220). For example, when at least one processor (110) identifies the table to be scanned in the query planner (231), the number of times (N) the full scan has been performed with respect to the table.
[0052] In operation 403, at least one processor (110) may update the number of times the full scan has been performed (N) by increasing the number of times the full scan has been performed (N) by '1' under conditions where the full scan related to the table of the database (220) is performed. For example, when at least one processor (110) identifies the table to be scanned in the query planner (231), it may update the number of times the full scan has been performed (N) for the table by using a counter included in the prefetch checker (241).
[0053] The method of operation in which the number of times (N) the total scan has been performed is initialized by at least one processor (110) can be described in various ways according to the embodiment. For example, the parameter representing the number of times (N) the total scan has been performed may be initialized when the database (220) is loaded (or opened) by the at least one processor (110). As another example, the parameter representing the number of times (N) the total scan has been performed may be initialized at a defined set period (e.g., 24 hours).
[0054] In operation 404, at least one processor (110) can identify whether the value corresponding to the number (N) exceeds a threshold value. The threshold value may be set in various ways depending on the embodiment. For example, the threshold value may be set by an application (210) or a database management system (230). For example, at least one processor (110) may perform prefetching on all tables included in the database (220) whenever the full scan is performed by setting the threshold value to '0'. For another example, at least one processor (110) may perform prefetching only on tables among all tables included in the database (220) for which the full scan has been performed more than the number of times corresponding to the threshold value by setting the threshold value to '5'.
[0055] In operation 405, at least one processor (110) may refrain from reading the data related to performing the full scan based on identifying the value corresponding to the number (N) that falls below the threshold value. For example, at least one processor (110) may identify whether the data requested according to the query is stored in the cache memory (233) based on the query to perform the full scan. At least one processor (110) may provide the data stored in the cache memory (233) to the application (210) based on identifying that the data requested according to the query is stored in the cache memory (233). At least one processor (110) can provide the data stored in the table of the database (220) to the application (210) by sequentially searching for the data included in the table of the database (220) according to the order of levels regarding the table, based on identifying that the data requested according to the query is not stored in the cache memory (233).
[0056] In operation 406, at least one processor (110) can identify the size (M) of the data related to performing the entire scan based on identifying the value corresponding to the number (N) of times exceeding the threshold value. For example, at least one processor (110) can identify the size (M) of the data by identifying the number of pages included in the data.
[0057] In operation 407, at least one processor (110) can identify whether the size (M) of the data exceeds a threshold size. For example, the threshold size may be set by an application (210) or a database management system (230). For example, at least one processor (110) can perform prefetching only on a table containing data greater than or equal to the threshold size, even if the value corresponding to the number (N) exceeds the threshold value, by setting the threshold size to the size of the data corresponding to the number of pages 'L'.
[0058] In operation 405, at least one processor (110) may refrain from reading the data in advance for performing the entire scan based on identifying the size (M) of the data that is less than the threshold size.
[0059] In operation 408, at least one processor (110) may set the table to perform the full scan as a target table for prefetching based on identifying the value corresponding to the number (N) of times exceeding the threshold value and the size (M) of the data exceeding the threshold size.
[0060] In operation 409, at least one processor (110) can prefetch the data related to performing the full scan from the table of the database (220) set as the target table for prefetching.
[0061] Unlike as illustrated in FIG. 4, the operation 403 of updating the number of times (N) the entire scan has been performed may be performed after the operation 409 according to the embodiment.
[0062] FIG. 4 illustrates that in operation 404, operations 406, 407, and 408 corresponding to the operation of comparing the size (M) and the threshold size based on the value exceeding the threshold value are performed, but this is merely illustrative. Operations 406, 407, and 408 may be omitted or skipped. For example, at least one processor (110) may perform operation 409 based on the value exceeding the threshold value. At least one processor (110) may perform operation 405 based on the value falling below the threshold value.
[0063] As described above, the electronic device (101) can reduce the time required to acquire data according to a query and mitigate the increase in load related to data input / output operations due to prefetching by selectively performing a prefetching operation according to the number of times a full scan is performed and the size of the data related to performing the full scan.
[0064] Referring again to FIG. 2, the prefetch checker (241) can transmit information about the target table for prefetching to the query planner (231). Based on the information about the target table, the query planner (231) can identify a query to perform prefetching related to the table of the database (220) to perform the full scan. Based on identifying the query to perform prefetching, the query planner (231) can transmit a command regarding prefetching to the query executor (232). The prefetcher (242) can perform a prefetching operation based on the command regarding prefetching.
[0065] The electronic device (101) can perform prefetching by using a prefetcher (242) to simultaneously read data stored in leaf nodes included in the table of the database (220), based on identifying the query to perform prefetching related to the table of the database (220). For example, reading data concurrently can be described as at least a portion of a first time interval for reading data stored in one node being overlapped with at least a portion of a second time interval for reading data stored in another node. For example, if the leaf nodes among the nodes included in the table of the database (220) contain data to be prefetched according to the query, the electronic device (101) can reduce the time required to acquire the data according to the query by performing prefetching by simultaneously reading the data stored in the leaf nodes. The method of operation for the electronic device (101) to simultaneously read data will be described later with reference to FIG. 7.
[0066] The electronic device (101) can identify the type of the parent node of the leaf nodes as a defined type in order to perform prefetching, which reads data stored in the leaf nodes concurrently.
[0067] The operation of the electronic device (101) identifying the type of the parent node of the leaf nodes included in the table of the database (220) as the type defined above is explained with reference to FIG. 5.
[0068] Figure 5 illustrates an example of a node structure to explain the types of nodes included in a database table.
[0069] Referring to FIG. 5, a table (500) is illustrated in which internal nodes correspond to two or more levels. The table (500) may include a node (510), first to x nodes (520_1, 520_2, ..., 520_x), ..., first to y nodes (530_1, 530_2, 530_3, 530_4, ..., 530_y), and first to z nodes (540_1, 540_2, ..., 540_z) (each x, y, and z are natural numbers). As described above, a parent node may store location data indicating the location of a child node. Each leaf node may store data to be prefetched according to a query.
[0070] Node (510) may correspond to Level 0. The first to x nodes (520_1, 520_2, ..., 520_x) may correspond to Level 1. The first to y nodes (530_1, 530_2, 530_3, 530_4, ..., 530_y) may correspond to Level n-1. The first to z nodes (540_1, 540_2, ..., 540_z) may correspond to Level n ('n' is a natural number greater than or equal to 3).
[0071] Each node included in the table may store information indicating the type of each of the said nodes. The information may include a value indicating the type of each of the said nodes. For example, the type may include the type of a root node, the type of an internal node, a defined type (e.g., the type of an internal node corresponding to the highest level among the internal nodes), and the type of a leaf node. For example, the information stored in node (510) may include a value corresponding to the type indicating the root node. The information stored in the first to x-th nodes (520_1, 520_2, ..., 520_x) may include a value corresponding to the type indicating the internal node. For example, if 'n' is a natural number greater than or equal to 4, the information stored in nodes having a level greater than level 1 and less than level n-1 may include a value corresponding to the type indicating the internal node. The information stored in the first to y nodes (530_1, 530_2, 530_3, 530_4, ..., 530_y) may include a value corresponding to the defined type. The information stored in the first to z nodes (540_1, 540_2, ..., 540_z) may include a value corresponding to the type of the leaf node. For example, the information may be stored in the header portion of the data included in each of the nodes. For example, the information may be used to search for at least one node among the nodes that stores data to be read in advance.
[0072] The electronic device (101) can sequentially identify information indicating the type of each of the nodes in order of the levels of the table in order to search for at least one node (e.g., a leaf node) that stores data to be read in advance among the nodes included in the table. The electronic device (101) can bypass identifying the types of the child nodes (e.g., node (540_1), node (540_2), and node (540_3)) of the node based on identifying the node (e.g., node (530_1)) that stores information indicating the defined type while performing the sequential identification, and can read the data stored in the child nodes in advance according to the query. For example, the types of the child nodes may indicate the leaf node. For example, the information may indicate the defined type by indicating the internal node that has the leaf nodes as child nodes. For example, the operation of bypassing the identification of the types of the child nodes can be described as an operation of not identifying the information representing the types of the child nodes in order to read the data stored in the child nodes in advance by using the location data of the node that stores the information representing the defined type.
[0073] The operation of pre-reading data stored in the leaf nodes by the electronic device (101) identifying the type of the parent node of the leaf nodes as the defined type is explained with reference to FIG. 6.
[0074] 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.
[0075] Referring to FIG. 6, in operation 601, at least one processor (110) can identify a query to perform the full scan related to a table of the database (220). For example, at least one processor (110) can identify the query requesting data desired by a user from an application (210). At least one processor (110) can identify a table to perform the full scan among a plurality of tables included in the database (220) based on the query plan generated by the query planner (231). As described above, the full scan can be described as an operation in which nodes included in the table of the database (220) are searched sequentially according to the order of levels related to the table.
[0076] In operation 602, at least one processor (110) can identify whether the table to perform the full scan is set as the target table for prefetching based on whether a value corresponding to the number of times (N) the full scan is performed exceeding the threshold value is identified and whether the size (M) of the data exceeding the threshold size is identified.
[0077] In operation 603, at least one processor (110) may refrain from prefetching data related to performing the full scan if it is identified that the table to be performed the full scan is not set as a target table for prefetching. For example, at least one processor (110) may identify whether data requested according to the query to be performed the full scan is stored in the cache memory (233) based on the query. At least one processor (110) may provide the data stored in the cache memory (233) to the application (210) based on identifying that the data requested according to the query is stored in the cache memory (233). At least one processor (110) can provide the data stored in the table of the database (220) to the application (210) by sequentially searching for the data included in the table of the database (220) according to the order of levels regarding the table, based on identifying that the data requested according to the query is not stored in the cache memory (233).
[0078] In operation 604, at least one processor (110) can identify a query to perform prefetching when the table to perform the full scan is set as the target table for prefetching. At least one processor (110) can sequentially identify the information indicating the type of each of the nodes in order of the levels regarding the table in order to search for at least one node (e.g., a leaf node) among the nodes included in the table that stores the data to be prefetched, based on the query related to the table. The full scan can be performed to obtain the data stored in all leaf nodes included in the table.
[0079] In operation 605, at least one processor (110) can identify whether it has identified a node storing information representing the defined type while performing the sequential identification.
[0080] In operation 606, at least one processor (110) may bypass identifying the type of at least one child node of the node (e.g., node (540_1), node (540_2), and node (540_3) of FIG. 5) based on identifying the node that stores information representing the defined type while performing the sequential identification.
[0081] In operation 607, at least one processor (110) can prefetch data stored in at least one child node of the node according to the query. For example, at least one processor (110) can obtain location data for each of the at least one child node stored in the node that stores information representing the defined type. At least one processor (110) can identify the at least one child node based on the location data. At least one processor (110) can prefetch data stored in the at least one child node identified based on the location data. For example, at least one processor (110) can identify the data stored in the at least one child node represented according to the obtained location data as the first data. At least one processor (110) can identify the second data, excluding the data stored in the cache memory (233) from the first data, as the data to be prefetched. At least one processor (110) can perform prefetching by reading the second data.
[0082] FIG. 6 illustrates that before operation 604 is performed, operation 601, which identifies a query to perform the full scan, and operation 602, which identifies whether the table to perform the full scan is set as the target table for prefetching, are performed, but this is merely illustrative. Operations 601 and 602 may be omitted or skipped. For example, at least one processor (110) may perform operation 604 based on a query according to various scan methods, such as an index scan, a range scan, or a unique scan, instead of a query to perform the full scan.
[0083] A specific operation method for reading data concurrently when the electronic device (101) performs prefetching is described with reference to FIG. 7.
[0084] Figure 7 illustrates an example for explaining the operation of simultaneously receiving data from a database.
[0085] Referring to FIG. 7, a data transfer environment (700) between a database (220) and a cache memory (233) is illustrated. Data contained in the first to k nodes (710_1, 710_2, ..., 710_k) can be transferred from the database (220) to the cache memory (233) while prefetching is being performed.
[0086] The electronic device (101) can read in advance data stored in one node (710_1) among the first to k nodes (710_1, 710_2, ..., 710_k) included in the table according to a query in the first time interval. The electronic device (101) can read in advance data stored in another node (710_2) among the first to k nodes (710_1, 710_2, ..., 710_k) included in the table according to the query in the second time interval. At least a portion of the second time interval may overlap with at least a portion of the first time interval.
[0087] As described above, the electronic device (101) can reduce the time required to obtain data according to a query by performing prefetching, which reads data stored in leaf nodes included in a table of the database (220) concurrently.
[0088] Figure 8 illustrates another example of a database system environment.
[0089] Referring to FIG. 8, the database system environment (800) may include an application (810), a database (820), and a database management system (830) (DBMS). The application (810) may correspond to the application (210) of FIG. 2. The database (820) may correspond to the database (220) of FIG. 2.
[0090] The database management system (830) may include a query planner (831), a query executor (832), a cache memory (833), and a prefetching manager (840). The database management system (830) may store, retrieve, modify, and / or delete data contained in the database (820). For example, the database management system (830) may be managed, controlled, and / or executed by at least one processor (110).
[0091] The electronic device (101) can obtain data requested according to a query from a database (820) and / or a cache memory (833) based on a query generated by an application (810) using a database management system (830).
[0092] The query planner (831) can generate a query plan regarding the execution method of a query generated in the application (810). The electronic device (101) can use the query planner (831) to identify a query to perform a full scan related to a table in the database (820). The query planner (831) can correspond to the query planner (231) of FIG. 2. The full scan can be described as an operation in which the electronic device (110) sequentially searches the nodes included in the table of the database (820) according to the order of levels related to the table.
[0093] The query executor (832) can perform the operation of processing the query based on the query plan generated by the query planner (831). The electronic device (101) can perform the full scan related to the table of the database (820) using the query executor (832). The query executor (832) can correspond to the query executor (232) of FIG. 2.
[0094] The prefetching manager (840) may include a prefetch checker (841), a prefetcher (842), and a bitmap manager (843).
[0095] The electronic device (101) can control a prefetching operation using a prefetching manager (840) when the query to perform the full scan related to the table of the database (820) is identified. The prefetching operation can be described as an operation of reading data included in the table of the database (820) and storing the read data in a cache memory (833) when the query to perform the full scan is identified. For example, the electronic device (101) can reduce the time required to acquire the data according to the query by performing the prefetching operation.
[0096] The electronic device (101) can identify whether to perform prefetching related to the table in the database (820) using a prefetch checker (841) based on identifying the query to perform the full scan related to the table in the database (820). The operation of the electronic device (101) identifying whether to perform prefetching using the prefetch checker (841) is the same as the operation of identifying whether to perform prefetching using the prefetch checker (241).
[0097] For example, the prefetch checker (841) may receive identification information for the query to perform the full scan from the query planner (831). Based on the identification information, the prefetch checker (841) may identify the target table for prefetching by identifying whether the table in the database (820) to perform the full scan satisfies the defined conditions (e.g., conditions regarding the number of times a full scan has been performed and conditions regarding the size of the data related to performing the full scan).
[0098] For example, the prefetch checker (841) can transmit information about the target table for prefetching to the query planner (831). Based on the information about the target table, the query planner (831) can identify a query to perform prefetching related to the table of the database (820) to perform the full scan. Based on identifying the query to perform prefetching, the query planner (831) can transmit a command regarding prefetching to the query executor (832). The prefetcher (842) can perform a prefetching operation based on the command regarding prefetching.
[0099] A bitmap manager (843) can generate a bitmap representing the location of each node included in a table of the database (820). The bitmap may be identified by each table included in the database (820) and may be stored in the database (820) in relation to the table. For example, the bitmap manager (843) may load a bitmap stored in the database (820) and transmit the loaded bitmap to a prefetcher (842). For example, an electronic device (101) may update the location of the nodes represented by the bitmap by tracking the location of the nodes included in the database (820).
[0100] The electronic device (101) can perform prefetching by concurrently reading data stored in all nodes included in the table of the database (820) according to the bitmap, based on identifying a query to perform prefetching in relation to the table of the database (820). For example, the electronic device (101) can reduce the time required to acquire the data according to the query by performing prefetching by concurrently reading data stored in all nodes included in the table of the database (820).
[0101] A bitmap representing the location of each node included in the table is described with reference to FIG. 9.
[0102] 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.
[0103] Referring to FIG. 9, a bitmap mapping environment (900) is illustrated. The bitmap mapping environment (900) may include a database (910) and a bitmap (920) representing the locations of nodes by table of the database (910). For example, the database (910) may include a table (901), a table (902), and a table (903).
[0104] The database (910) may include a unit storage space (910_0) corresponding to address (0), a unit storage space (910_1) corresponding to address (1), a unit storage space (910_2) corresponding to address (2), a unit storage space (910_3) corresponding to address (3), a unit storage space (910_4) corresponding to address (4), a unit storage space (910_5) corresponding to address (5), a unit storage space (910_6) corresponding to address (6), a unit storage space (910_7) corresponding to address (7), a unit storage space (910_8) corresponding to address (8), and a unit storage space (910_9) corresponding to address (9).
[0105] Nodes included in the table (901) may be stored in a unit storage space (910_0) corresponding to address (0), a unit storage space (910_1) corresponding to address (1), a unit storage space (910_3) corresponding to address (3), a unit storage space (910_4) corresponding to address (4), a unit storage space (910_5) corresponding to address (5), and a unit storage space (910_6) corresponding to address (6). A bit map (921) indicates the location of the nodes of the table (901) and may include bits according to the address order of the database (910). The bit value of the bit map (921) may be identified as '1' when it is identified that a node of the table (901) is stored in the unit storage space, and as '0' when it is identified that a node of the table (901) is not stored in the unit storage space. The bit map (921) can be described as data having values of '1101111000...'.
[0106] Nodes included in the table (902) may be stored in a unit storage space (910_2) corresponding to address (2) and a unit storage space (910_9) corresponding to address (9). A bit map (922) indicates the location of the nodes of the table (902) and may include bits according to the address order of the database (910). The bit value of the bit map (922) may be identified as '1' when it is identified that a node of the table (902) is stored in the unit storage space, and as '0' when it is identified that a node of the table (901) is not stored in the unit storage space. The bit map (922) may be described as data having a value of '0010000001...'.
[0107] Nodes included in the table (903) may be stored in a unit storage space (910_7) corresponding to address (7) and a unit storage space (910_8) corresponding to address (8). A bit map (923) indicates the location of the nodes of the table (903) and may include bits according to the address order of the database (910). The bit value of the bit map (923) may be identified as '1' when it is identified that a node of the table (903) is stored in the unit storage space, and as '0' when it is identified that a node of the table (903) is not stored in the unit storage space. The bit map (923) may be described as data having a value of '0000000110...'.
[0108] FIG. 10 is a flowchart illustrating a method for performing prefetching on data stored in nodes included in a table using a bitmap.
[0109] Referring to FIG. 10, in operation 1001, at least one processor (110) can identify a query to perform the full scan related to a table in the database. For example, at least one processor (110) can identify the query requesting data desired by a user from an application (810). At least one processor (110) can identify a table to perform the full scan among a plurality of tables included in the database (820) based on the query plan generated by the query planner (831). As described above, the full scan can be described as an operation in which nodes included in the table of the database (820) are searched sequentially according to the order of levels related to the table.
[0110] In operation 1002, at least one processor (110) can identify whether the table to perform the full scan is set as the target table for prefetching based on whether a value corresponding to the number of times (N) the full scan is performed exceeding the threshold value is identified and whether the size (M) of the data exceeding the threshold size is identified.
[0111] In operation 1003, at least one processor (110) may refrain from prefetching data related to performing the full scan when it is identified that the table to be performed the full scan is not set as a target table for prefetching. For example, at least one processor (110) may identify whether data requested according to the query to be performed the full scan is stored in the cache memory (833) based on the query. At least one processor (110) may provide the data stored in the cache memory (833) to the application (810) based on identifying that the data requested according to the query is stored in the cache memory (833). At least one processor (110) can provide the data stored in the table of the database (820) to the application (810) by sequentially searching for the data included in the table of the database (820) according to the order of the levels regarding the table, based on identifying that the data requested according to the query is not stored in the cache memory (833).
[0112] In operation 1004, at least one processor (110) can identify whether a bitmap exists in the database (820) when the table to be scanned is set as the target table for prefetching.
[0113] In operation 1005, at least one processor (110) can load the bitmap stored in the database (820) when it is identified that the bitmap exists in the database (820). At least one processor (110) can identify the bitmap representing the location of each node included in the table.
[0114] In operation 1006, at least one processor (110) can prefetch data related to the entire scan by concurrently reading data stored in nodes identified according to the bit map based on identifying the value corresponding to the number (N) exceeding the threshold value and the size (M) of the data exceeding the threshold size, and by storing the read data in the cache memory (833). For example, at least one processor (110) can identify the data represented according to the bit map as the first data. At least one processor (110) can identify the second data, excluding the data stored in the cache memory (833) from the first data, as the data to be prefetched. At least one processor (110) can perform prefetching by reading the second data.
[0115] In operation 1007, at least one processor (110) may perform the full scan of the table in the database (820) when it is identified that the bit map does not exist in the database (820). At least one processor (110) may, based on performing the full scan, generate a bit map indicating the locations of the nodes included in the table where the full scan was performed.
[0116] As described above, the electronic device (101) can reduce the time required to obtain data according to a query by performing prefetching to simultaneously read data stored in all nodes included in the table of the database (820) using a bitmap representing the locations of nodes included in the table.
[0117] The electronic device (101) may correspond to the electronic device (1101) described with reference to FIG. 11 below.
[0118] FIG. 11 is a block diagram of an electronic device in a network environment according to various embodiments.
[0119] Referring to FIG. 11, in a network environment (1100), an electronic device (1101) may communicate with an electronic device (1102) through a first network (1198) (e.g., a short-range wireless communication network) or with at least one of an electronic device (1104) or a server (1108) through a second network (1199) (e.g., a long-range wireless communication network). According to one embodiment, the electronic device (1101) may communicate with the electronic device (1104) through a server (1108). According to one embodiment, the electronic device (1101) may include a processor (1120), memory (1130), input module (1150), sound output module (1155), display module (1160), audio module (1170), sensor module (1176), interface (1177), connection terminal (1178), haptic module (1179), camera module (1180), power management module (1188), battery (1189), communication module (1190), subscriber identification module (1196), or antenna module (1197). In some embodiments, at least one of these components (e.g., connection terminal (1178)) may be omitted from the electronic device (1101), or one or more other components may be added. In some embodiments, some of these components (e.g., sensor module (1176), camera module (1180), or antenna module (1197)) may be integrated into a single component (e.g., display module (1160)).
[0120] The processor (1120) can, for example, execute software (e.g., program (1140)) to control at least one other component (e.g., hardware or software component) of the electronic device (1101) connected to the processor (1120) and perform various data processing or operations. According to one embodiment, as at least part of the data processing or operations, the processor (1120) can store commands or data received from other components (e.g., sensor module (1176) or communication module (1190)) in volatile memory (1132), process the commands or data stored in volatile memory (1132), and store the resulting data in non-volatile memory (1134). According to one embodiment, the processor (1120) may include a main processor (1121) (e.g., a central processing unit or an application processor) or an auxiliary processor (1123) that can operate independently or together with it (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor). For example, if the electronic device (1101) includes a main processor (1121) and an auxiliary processor (1123), the auxiliary processor (1123) may be configured to use less power than the main processor (1121) or to be specialized for a designated function. The auxiliary processor (1123) may be implemented separately from the main processor (1121) or as part thereof.
[0121] The auxiliary processor (1123) may control at least some of the functions or states associated with at least one component of the electronic device (1101) (e.g., display module (1160), sensor module (1176), or communication module (1190)) on behalf of the main processor (1121) while the main processor (1121) is in an inactive (e.g., sleep) state, or together with the main processor (1121) while the main processor (1121) is in an active (e.g., application execution) state. According to one embodiment, the auxiliary processor (1123) (e.g., image signal processor or communication processor) may be implemented as part of another functionally related component (e.g., camera module (1180) or communication module (1190)). According to one embodiment, the auxiliary processor (1123) (e.g., neural network processing unit) may include a hardware structure specialized for processing an artificial intelligence model. The artificial intelligence model may be generated through machine learning. Such learning may be performed, for example, on the electronic device (1101) itself where the artificial intelligence model is executed, or through a separate server (e.g., server (1108)). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model may include a plurality of artificial neural network layers.An artificial neural network may be a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to the hardware structure, the artificial intelligence model may include a software structure, either additionally or substantially.
[0122] The memory (1130) can store various data used by at least one component of the electronic device (1101) (e.g., processor (1120) or sensor module (1176)). The data may include, for example, input data or output data for software (e.g., program (1140)) and related commands. The memory (1130) may include volatile memory (1132) or non-volatile memory (1134).
[0123] The program (1140) may be stored as software in memory (1130) and may include, for example, an operating system (1142), middleware (1144), or an application (1146).
[0124] The input module (1150) can receive commands or data to be used for a component of the electronic device (1101) (e.g., processor (1120)) from outside the electronic device (1101) (e.g., user). The input module (1150) may include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0125] The sound output module (1155) can output a sound signal to the outside of the electronic device (1101). The sound output module (1155) may include, for example, a speaker or a receiver. The speaker may be used for general purposes, such as multimedia playback or recording playback. The receiver may be used to receive incoming calls. According to one embodiment, the receiver may be implemented separately from the speaker or as part thereof.
[0126] The display module (1160) can visually provide information to an external (e.g., user) of the electronic device (1101). The display module (1160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling said device. According to one embodiment, the display module (1160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of the force generated by said touch.
[0127] The audio module (1170) can convert sound into an electrical signal or, conversely, convert an electrical signal into sound. According to one embodiment, the audio module (1170) can acquire sound through the input module (1150) or output sound through the sound output module (1155) or an external electronic device (e.g., electronic device (1102)) (e.g., speaker or headphones) connected directly or wirelessly to the electronic device (1101).
[0128] The sensor module (1176) can detect the operating state of the electronic device (1101) (e.g., power or temperature) or the external environmental state (e.g., user state) and generate an electrical signal or data value corresponding to the detected state. According to one embodiment, the sensor module (1176) may include, for example, a gesture sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biosensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0129] The interface (1177) may support one or more specified protocols that can be used for the electronic device (1101) to be connected directly or wirelessly to an external electronic device (e.g., electronic device (1102)). According to one embodiment, the interface (1177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0130] The connection terminal (1178) may include a connector through which the electronic device (1101) can be physically connected to an external electronic device (e.g., electronic device (1102)). According to one embodiment, the connection terminal (1178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0131] The haptic module (1179) can convert an electrical signal into a mechanical stimulus (e.g., vibration or movement) or an electrical stimulus that can be perceived by the user through tactile or kinesthetic senses. According to one embodiment, the haptic module (1179) may include, for example, a motor, a piezoelectric element, or an electric stimulation device.
[0132] The camera module (1180) can capture still images and video. According to one embodiment, the camera module (1180) may include one or more lenses, image sensors, image signal processors, or flashes.
[0133] The power management module (1188) can manage power supplied to the electronic device (1101). According to one embodiment, the power management module (1188) can be implemented, for example, as at least part of a power management integrated circuit (PMIC).
[0134] The battery (1189) can supply power to at least one component of the electronic device (1101). According to one embodiment, the battery (1189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0135] The communication module (1190) can support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between an electronic device (1101) and an external electronic device (e.g., electronic device (1102), electronic device (1104), or server (1108)), and the performance of communication through the established communication channel. The communication module (1190) may include one or more communication processors that operate independently of the processor (1120) (e.g., application processor) and support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (1190) may include a wireless communication module (1192) (e.g., cellular communication module, short-range wireless communication module, or GNSS (global navigation satellite system) communication module) or a wired communication module (1194) (e.g., LAN (local area network) communication module, or power line communication module). The corresponding communication module among these communication modules can communicate with an external electronic device (1104) through a first network (1198) (e.g., a short-range communication network such as Bluetooth, WiFi (wireless fidelity) direct, or IrDA (infrared data association)) or a second network (1199) (e.g., a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules may be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (1192) can identify or authenticate the electronic device (1101) within a communication network such as the first network (1198) or the second network (1199) using subscriber information (e.g., International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module (1196).
[0136] The wireless communication module (1192) can support 5G networks and next-generation communication technologies following 4G networks, for example, new radio access technology. NR access technology can support high-speed transmission of high-capacity data (enhanced mobile broadband (eMBB)), minimization of terminal power and connection of multiple terminals (massive machine type communications (mMTC)), or high reliability and low latency (ultra-reliable and low-latency communications (URLLC)). The wireless communication module (1192) can support a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate, for example. The wireless communication module (1192) can support various technologies for securing performance in the high-frequency band, such as beamforming, massive MIMO (multiple-input and multiple-output), full-dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large-scale antenna. The wireless communication module (1192) can support various requirements specified in the electronic device (1101), external electronic device (e.g., electronic device (1104)), or network system (e.g., second network (1199)). According to one embodiment, the wireless communication module (1192) can support a Peak data rate (e.g., 20 Gbps or more) for eMBB realization, loss coverage (e.g., 164 dB or less) for mMTC realization, or U-plane latency (e.g., downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less) for URLLC realization.
[0137] An antenna module (1197) can transmit a signal or power to or from an external source (e.g., an external electronic device). According to one embodiment, the antenna module (1197) may include an antenna comprising a radiator made of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). According to one embodiment, the antenna module (1197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as a first network (1198) or a second network (1199), may be selected from the plurality of antennas, for example, by a communication module (1190). A signal or power may be transmitted or received between the communication module (1190) and an external electronic device through the selected at least one antenna. According to some embodiments, in addition to the radiator, other components (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as part of the antenna module (1197).
[0138] According to various embodiments, the antenna module (1197) may form a mmWave antenna module. According to one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent to a first surface (e.g., bottom surface) of the printed circuit board and capable of supporting a specified high frequency band (e.g., mmWave band), and a plurality of antennas (e.g., array antennas) disposed on or adjacent to a second surface (e.g., top surface or side surface) of the printed circuit board and capable of transmitting or receiving a signal of the specified high frequency band.
[0139] At least some of the above components can be connected to each other via a communication method between peripheral devices (e.g., bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)) and exchange signals (e.g., commands or data) with each other.
[0140] According to one embodiment, commands or data may be transmitted or received between the electronic device (1101) and an external electronic device (1104) through a server (1108) connected to a second network (1199). Each of the external electronic devices (1102, or 1104) may be the same or a different type of device as the electronic device (1101). According to one embodiment, all or part of the operations performed on the electronic device (1101) may be performed on one or more of the external electronic devices (1102, 1104, or 1108). For example, if the electronic device (1101) needs to perform a function or service automatically or in response to a request from a user or another device, the electronic device (1101) may request one or more external electronic devices to perform at least part of the function or service instead of performing the function or service itself or additionally. One or more external electronic devices that receive the above request may execute at least part of the requested function or service, or additional function or service related to the request, and transmit the result of the execution to the electronic device (1101). The electronic device (1101) may provide the result as is or additionally processed as at least part of the response to the request. For this purpose, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device (1101) may provide ultra-low latency services using, for example, distributed computing or mobile edge computing. In one embodiment, the external electronic device (1104) may include an Internet of Things (IoT) device. The server (1108) may be an intelligent server using machine learning and / or neural networks.According to one embodiment, an external electronic device (1104) or server (1108) may be included within the second network (1199). The electronic device (1101) may be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.
[0141] The technical problems to be solved in this disclosure are not limited to those mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art to which this disclosure belongs.
[0142] As described above, an electronic device (e.g., electronic device (101)) may include at least one processor (e.g., at least one processor (110)) comprising a processing circuit; and a memory (e.g., memory (120)) comprising one or more storage media for storing instructions. The instructions may cause the electronic device to prefetch data stored in the 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. The electronic device may bypass identifying the type of at least one child node of the node and prefetch data stored in the at least one child node of the node according to the query. The information indicating the type of each of the nodes may be stored in each of the nodes included in the table. The information indicating the type of each of the above nodes can be used to search for at least one node among the nodes that stores data to be read in advance.
[0143] When the above instructions are executed individually or collectively by the at least one processor: in a first time interval according to the query, data stored in the first child node included in the at least one child node is read in advance, and in a second time interval according to the query, data stored in the second child node included in the at least one child node is read in advance, and at least a part of the second time interval is overlapped with at least a part of the first time interval, the electronic device may be caused.
[0144] The above instructions, when executed individually or collectively by the at least one processor, may cause the electronic device to: identify the node storing the information representing the defined type while performing the sequential identification; acquire location data representing the location of each of the at least one child node stored in the node storing the information representing the defined type; identify the at least one child node based on the location data; and pre-read the data stored in the at least one child node identified based on the location data. An operation of bypassing the identification of the type of the at least one child node may be an operation of not identifying the information representing 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.
[0145] The above instructions, when executed individually or collectively by the at least one processor, may cause the electronic device to perform the prefetching by: based on acquiring the location data stored in the node storing the information representing the defined type; identifying the data stored in the at least one child node represented according to the acquired location data 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 prefetched, and reading the second data.
[0146] Each of the above nodes corresponds to a root node that does not have a parent node, an internal node, or a leaf node that does not have a child node, and the type of the at least one child node represents the leaf node, and the information can represent the defined type by representing the internal node that has the leaf node as the child node.
[0147] When the above instructions are executed individually or collectively by the at least one processor: the electronic device may be caused to sequentially identify the information indicating the type of each of the nodes according to the order of the levels, based on performing a full scan related to the table. The full scan may be performed to obtain data stored in all leaf nodes included in the table.
[0148] When the above instructions are executed individually or collectively by the at least one processor: the electronic device may be caused to identify the query to perform the full scan related to the table, identify a value corresponding to the number of times the full scan related to the table has been performed based on the query, pre-read data related to performing the full scan based on the identification of the value corresponding to the number of times the threshold value is exceeded, and refrain from pre-reading the data related to performing the full scan based on the identification of the value corresponding to the number of times the threshold value is not exceeded.
[0149] The above information includes a value representing the type of each of the above nodes, and the information can be stored in the header of each of the above nodes.
[0150] Each of the above nodes may correspond to a root node without a parent node, an internal node, or a leaf node without a child node. Each of the above nodes may have a level based on the hierarchical structure between the parent node and the child node. The order of the levels may be identified to determine the search order for each of the above nodes. The table may have 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 above internal nodes is two or more, and all leaf nodes correspond to the same level.
[0151] As described above, an electronic device (e.g., electronic device (101)) may include at least one processor (e.g., at least one processor (110)) comprising a processing circuit; and a memory (e.g., memory (120)) that stores instructions and includes one or more storage media. When the instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to identify a query to perform a full scan related to a table in a database, identify a value corresponding to the number of times the full scan related to the table has been performed based on the query, pre-read data related to the full scan based on the identification of the value corresponding to the number of times the full scan related to the table has been performed, and refrain from pre-reading data related to the full scan based on the identification of the value corresponding to the number of times the full scan related to the table has been performed.
[0152] The parameter indicating the above number of times can be initialized when the database is loaded by the at least one processor.
[0153] When the above instructions are executed individually or collectively by the at least one processor: the electronic device may be caused to update the number under the condition that the entire scan related to the table is performed.
[0154] When the above instructions are executed individually or collectively by the at least one processor: the electronic device may be caused to pre-read the data related to performing the entire scan based on the query, identifying the size of the data related to performing the entire scan, and based on identifying the value corresponding to the size exceeding a threshold size and the number of times exceeding the threshold value.
[0155] When the above instructions are executed individually or collectively by the at least one processor: in a first time interval, according to the query, data stored in one of the nodes included in the table is read in advance, and in a second time interval, data stored in another of the nodes included in the table is read in advance according to the query, and at least a part of the second time interval is overlapped with at least a part of the first time interval, the electronic device may be caused.
[0156] When the above instructions are executed individually or collectively by the at least one processor: the electronic device may be caused to pre-read the data by identifying a bitmap that is stored in relation to the table and indicates the location of each node included in the table, and by identifying the value corresponding to the number of times the threshold value is exceeded, reading the data stored in the nodes identified according to the bitmap, and storing the read data.
[0157] When the above instructions are executed individually or collectively by the at least one processor, the electronic device may be caused to identify the data represented according to the bit map as the first data, identify the second data excluding the data stored in the cache memory from the first data as the data to be prefetched, and perform prefetching by reading the second data.
[0158] The above instructions, when executed individually or collectively by the at least one processor, may cause the electronic device to identify the type of at least one child node of the node and to prefetch data stored in the at least one child node of the node according to the query, by bypassing the identification of the type of at least one child node of the node and, based on the query, identify the information indicating the type of each node included in the table in order of levels regarding the table, and identify the node storing the information indicating the type defined during the sequential identification. The information indicating the type of each of the nodes may be stored in each of the nodes included in the table. The information indicating the type of each of the nodes may be used to search for at least one node among the nodes that stores the data to be prefetched.
[0159] A non-transient computer-readable storage medium as described above may store one or more programs. The one or more programs may include instructions that, when executed by an electronic device (e.g., electronic device (101)), cause the electronic device to identify a query to perform prefetching in relation to a table of a database, and based on said query, sequentially identify information indicating the type of each node included in said table according to the order of levels regarding said table, and based on identifying a node storing information indicating the type defined during said sequential identification, bypass identifying the type of at least one child node of said node, and prefetch data stored in said at least one child node of said node according to said query. The information indicating the type of said node may be stored in said nodes included in said table. The information indicating the type of said node may be used to search for at least one node among said nodes that stores the data to be prefetched.
[0160] The above one or more programs may include instructions that, when executed by the electronic device: in a first time interval according to the query, pre-read data stored in a first child node included in the at least one child node; in a second time interval according to the query, pre-read data stored in a second child node included in the at least one child node; and cause the electronic device such that at least a portion of the second time interval overlaps with at least a portion of the first time interval.
[0161] The above one or more programs may include instructions that, when executed by the electronic device: based on identifying the node storing the information representing the defined type while performing the sequential identification; acquire location data representing the location of each of the at least one child node stored in the node storing the information representing the defined type; identify the at least one child node based on the location data; and pre-read the data stored in the at least one child node identified based on the location data. An operation of bypassing the identification of the type of the at least one child node may be an operation of not identifying the information representing 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.
[0162] A non-transient computer-readable storage medium as described above may store one or more programs. The one or more programs may include instructions that, when executed by an electronic device (e.g., electronic device (101)): identify a query to perform a full scan related to a table in a database, identify a value corresponding to the number of times the full scan related to the table has been performed based on the query, pre-read data related to the full scan based on the identification of the value corresponding to the number of times the full scan has been performed based on the identification of the value corresponding to the number of times the threshold has been exceeded, and refrain from pre-reading the data related to the full scan based on the identification of the value corresponding to the number of times the threshold has been not met.
[0163] The effects obtainable from the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art to which the present disclosure belongs.
[0164] The electronic device according to the various embodiments disclosed in this document may be of various forms. The electronic device may include, for example, a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a consumer electronics device. The electronic device according to the embodiments of this document is not limited to the devices described above.
[0165] The various embodiments of this document and the terms used therein are not intended to limit the technical features described in this document to specific embodiments, and should be understood to include various modifications, equivalents, or substitutions of said embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of said items unless the relevant context clearly indicates otherwise. In this document, phrases such as "A or B," "at least one of A and B," "at least one of A or B," "A, B or C," "at least one of A, B and C," and "at least one of A, B, or C" may each include any one of the items listed together in the corresponding phrase, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used simply to distinguish said components from other said components and do not limit said components in any other aspect (e.g., importance or order). Where any (e.g., 1st) component is referred to as "coupled" or "connected" to another (e.g., 2nd) component, with or without the terms "functionally" or "communicationly," it means that said any component may be connected to said other component directly (e.g., via a wire), wirelessly, or through a third component.
[0166] The term “module” as used in the various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit, for example. A module may be a component formed integrally, or a minimum unit of said component or a part thereof that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0167] Various embodiments of the present document may be implemented as software (e.g., program (1140)) comprising one or more instructions stored in a storage medium (e.g., internal memory (1136) or external memory (1138)) readable by a machine (e.g., electronic device (1101)). For example, a processor (e.g., processor (1120)) of the machine (e.g., electronic device (1101)) may call at least one of the one or more instructions stored from the storage medium and execute it. This enables the machine to be operated to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code that can be executed by an interpreter. The storage medium readable by the machine may be provided in the form of a non-transitory storage medium. Here, 'non-temporary' simply means that the storage medium is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily.
[0168] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or an application store (e.g., Play Store). ™ It can be distributed online (e.g., downloaded or uploaded) through ) or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
[0169] According to various embodiments, each component (e.g., module or program) of the components described above may include a singular or multiple entities, and some of the multiple entities may be separated and placed in other components. According to various embodiments, one or more of the components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Generally or additionally, multiple components (e.g., module or program) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each of the multiple components in the same or similar manner as those performed by the corresponding component among the multiple components prior to integration. According to various embodiments, operations performed by the module, program, or other components may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.
Claims
1. In an electronic device, At least one processor including a processing circuit; and Memory that stores instructions and includes one or more storage media, When the above instructions are executed individually or collectively by the at least one processor: 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 table is identified sequentially according to the order of levels regarding the 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, causing, 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.
2. In Claim 1, When the above instructions are executed individually or collectively by the at least one processor: 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, causing, Electronic device.
3. In Claim 1, When the above instructions are executed individually or collectively by the at least one processor: 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, causing, 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.
4. In Claim 3, When the above instructions are executed individually or collectively by the at least one processor: 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, causing, Electronic device.
5. 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.
6. In Claim 5, When the above instructions are executed individually or collectively by the at least one processor: 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, causing, The above full scan is performed to obtain data stored in all leaf nodes included in the table, Electronic device.
7. In Claim 6, When the above instructions are executed individually or collectively by the at least one processor: 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, causing, Electronic device.
8. 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.
9. 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.
10. In a non-transient computer-readable storage medium storing one or more programs, said one or more programs, when executed by an electronic device: 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 table is identified sequentially according to the order of levels regarding the 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, 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.
11. In Claim 10, When one or more of the above programs are executed by the electronic device: 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 Non-transient computer-readable storage media.
12. In Claim 10, When one or more of the above programs are executed by the electronic device: 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 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, 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.
13. In Claim 12, When one or more of the above programs are executed by the electronic device: 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, Includes instructions that cause the above electronic device, Non-transient computer-readable storage media.
14. In Claim 10, 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. Non-transient computer-readable storage media.
15. In Claim 14, When one or more of the above programs are executed by the electronic device: 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. Includes instructions that cause the above electronic device, The above full scan is performed to obtain data stored in all leaf nodes included in the table, Non-transient computer-readable storage media.