Back table query method and device, equipment and storage medium
By determining the sorting pattern based on the table lookup operator in the relational database, the number of data page searches is reduced, which solves the inefficiency problem caused by frequent data page retrieval in secondary index queries and achieves more efficient table lookup queries.
Patent Information
- Application Number
- CN202310799696.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-07-03
AI Technical Summary
In relational databases, frequent data page retrievals when querying using secondary indexes can negatively impact the efficiency of table lookups, leading to reduced query performance.
By determining the sorting mode based on the table lookup operator, including the original sorting mode, the overall sorting mode, and the partial sorting mode, the row data identifiers in the query table are sorted, reducing the number of times data pages need to be searched.
By reducing the number of times data pages need to be searched, the efficiency of table lookup queries is improved.
Smart Images

Figure CN116662350B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the technical field of database, and particularly relate to a back table query method and device, equipment and storage medium. BACKGROUND
[0002] In a relational database, an index can be created on a column of a table, and the index can be used to effectively improve the back table query efficiency. Each table in the database has and only has one cluster index, and other indexes except the cluster index are called secondary indexes.
[0003] When a query is performed by using a secondary index, if the query statement also involves a column other than the secondary index, back table needs to be performed, that is, the corresponding row data identifier code is found by using the secondary index, and then the target data (i.e., complete record) is found by using the row data identifier code, and then the column information other than the secondary index can be obtained.
[0004] However, when the record in the query table is located by using the row data identifier code, the data page needs to be searched, and the frequent search of the data page will greatly affect the query efficiency of the back table query. SUMMARY
[0005] Embodiments of the present disclosure provide a back table query method, device, equipment and storage medium, which can reduce the number of times of searching the data page and improve the query efficiency of the back table query.
[0006] In a first aspect, the embodiments of the present disclosure provide a back table query method, comprising: determining a sorting mode based on a back table operator; the sorting mode comprises an original sorting mode, an overall sorting mode and a local sorting mode; sorting row data identifier codes in a query table according to the sorting mode to obtain a target sorting result; determining a data page where each row data identifier code is located according to the target sorting result; and extracting target data corresponding to the row data identifier code in the data page; wherein the row data identifier code is a cluster key value or a row number.
[0007] In a second aspect, the embodiments of the present disclosure further provide a back table query device, comprising: a sorting mode determination module configured to determine a sorting mode based on a back table operator; the sorting mode comprises an original sorting mode, an overall sorting mode and a local sorting mode; a sorting module configured to sort row data identifier codes in a query table according to the sorting mode to obtain a target sorting result; a data page determination module configured to determine a data page where each row data identifier code is located according to the target sorting result; and a target data extraction module configured to extract target data corresponding to the row data identifier code in the data page; wherein the row data identifier code is a cluster key value or a row number.
[0008] In a third aspect, the embodiments of the present disclosure further provide an electronic device, comprising:
[0009] one or more processors;
[0010] a storage device for storing one or more programs,
[0011] When the one or more programs are executed by the one or more processors, the one or more processors implement the table lookup method as described in the embodiments of the present disclosure.
[0012] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium containing computer executable instructions for executing the table lookup method as described in the embodiments of the present disclosure when executed by a computer processor.
[0013] In the embodiments of the present disclosure, the sorting mode is determined based on the table lookup operator; the sorting mode includes an original sorting mode, an overall sorting mode and a local sorting mode; the row data identifier codes in the query table are sorted according to the sorting mode to obtain a target sorting result; the data page where each row data identifier code is located is determined according to the target sorting result; the target data corresponding to the row data identifier code is extracted in the data page; and the row data identifier code is an aggregate key value or a row number. In the embodiments of the present disclosure, the aggregate key value or the row number in the query table is sorted by the sorting mode to obtain the target sorting result, and the data page where the aggregate key value or the row number is located is determined according to the target sorting result, which can reduce the number of times of searching the data page and improve the query efficiency of the table lookup query. BRIEF DESCRIPTION OF DRAWINGS
[0014] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent as various embodiments of the present disclosure are disclosed in detail with reference to the drawings. Throughout the drawings, the same or similar reference numerals can refer to the same or similar elements. It should be understood that the drawings are schematic, and the original and elements are not necessarily drawn according to the scale.
[0015] Figure 1 A table lookup method flowchart provided by the embodiments of the present disclosure;
[0016] Figure 2 Another table lookup method flowchart provided by the embodiments of the present disclosure;
[0017] Figure 3 A table lookup device structure diagram provided by the embodiments of the present disclosure;
[0018] Figure 4 A structure diagram of an electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION
[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein; rather, these embodiments are provided so as to more completely and thoroughly understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes and are not intended to limit the scope of protection of the present disclosure.
[0020] It should be understood that each of the steps recited in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0021] The term "comprising" and variations thereof as used herein are open-ended, that is "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Related terms are defined in the following description.
[0022] It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0023] It should be noted that the modification of "one" or "multiple" mentioned in the present disclosure is illustrative rather than limiting, and those skilled in the art should understand that, unless otherwise explicitly indicated in the context, it should be understood as "one or more".
[0024] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0025] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained in a proper manner according to relevant laws and regulations.
[0026] For example, when responding to the active request of the user, a prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require the acquisition and use of the personal information of the user. Thus, the user can voluntarily choose whether to provide the personal information to the electronic device, application program, server or storage medium, etc. software or hardware performing the operation of the technical solutions of the present disclosure according to the prompt information.
[0027] As an optional but non-limiting implementation, in response to receiving the active request of the user, the manner of sending the prompt information to the user may be, for example, a pop-up window manner, in which the prompt information may be presented in the form of text. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0028] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation of the present disclosure. Other manners that meet the relevant laws and regulations can also be applied to the implementation of the present disclosure.
[0029] It can be understood that the data involved in the technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and the relevant provisions.
[0030] Figure 1 A flowchart of a back table query method provided by the embodiment of the present disclosure, the embodiment of the present disclosure is applicable to the case of data query, especially the case of locating the complete record of the aggregation key value or the row number in the query table by using the back table operator, that is, the case of locating the complete record of the aggregation key value or the row number in the data page by using the back table operator. The method can be executed by a back table query device, which can be implemented in the form of software and / or hardware, and can be implemented by an electronic device, which can be a mobile terminal, a PC terminal, or a server, etc.
[0031] It should be noted that the technical solution provided in the embodiment can be used for data query, and is specifically used in the case of locating target data (i.e., complete record) by using a back table operator.
[0032] For example, for the SQL statement input by the user, the database management system first performs syntax semantic analysis on the SQL statement, and then generates an optimal execution plan. The execution plan splits the entire query process into individual operators in a tree structure. In actual execution, these operators are executed from the bottom up, and data is transmitted from bottom to top until the final result is obtained.
[0033] For example:
[0034] Create table T, which contains 3 columns: C1, C2, C3:
[0035] CREATE TABLE T (C1 INT, C2 INT, C3 INT);
[0036] Create a two-level index I1 on the C2 column of table T:
[0037] CREATE INDEX I1 ON T (C2);
[0038] Query all records in table T where the value in column C2 is less than 10 and return the data in column C1:
[0039] SELECT C1 FROM T WHERE C2 < 10;
[0040] The above query statement needs to first query the value in column C2. Since there is a secondary index on column C2, the secondary index will be used for the query. However, the final value in column C1 needs to be returned, which involves columns other than the secondary index, so a table lookup is required. That is, after finding the target row that meets the condition through the secondary index, the complete record corresponding to the target row needs to be further found, and then the value in column C1 is obtained from the complete record.
[0041] For the above query statement, the following execution plan can be generated:
[0042] #NSET2: [1, 1, 20]
[0043] #PRJT2: [1, 1, 20]; exp_num(2), is_atom(FALSE)
[0044] #BLKUP2: [1, 1, 20]; I1(T)
[0045] #SSEK2: [1, 1, 20]; scan_type(ASC), I1(T), scan_range(null2, 10)
[0046] The above execution plan contains four operators: SSEK2, BLKUP2, PRJT2, and NSET2. Execution starts from the bottommost SSEK2 operator.
[0047] SSEK2 operator: a scan operator that uses the I1 index on table T to quickly filter the aggregate key values or row numbers (i.e., row data identification codes) of records that meet the filter condition C2 < 10;
[0048] BLKUP2 operator: a table lookup operator that uses the aggregate key values or row numbers filtered out by the SSEK2 operator to locate the corresponding complete records in table T;
[0049] PRJT2 operator: obtains the value of the final query item C1 column from the complete record found by the BLKUP2 operator;
[0050] NSET2 operator: outputs the final result set to the user.
[0051] It should be noted that the steps of the above query statement are merely examples, and the specific steps of the query statement may include multiple steps depending on the actual situation. However, in the case of a table lookup query, the table lookup operator will be involved in all cases. The technical solution provided by the embodiments of the present invention can also be understood as an optimization of the step of locating the complete record using the table lookup operator.
[0052] S110. Determine the sorting mode based on the table return operator.
[0053] The sorting modes include original sorting mode, overall sorting mode, and partial sorting mode. Original sorting mode can be understood as not processing the order of row data identifiers in the query table. Overall sorting mode can be used to sort the row data identifiers in the query table all at once. Partial sorting mode can be used to divide the row data identifiers in the query table into multiple groups, and sort each group separately.
[0054] In this embodiment, before the table lookup operator processes the row data identifiers in the lookup table, pre-set parameters input by the user can be received, and the sorting mode for each execution can be determined based on the pre-set parameters. Three different sorting modes can correspond to three different parameters; this embodiment does not limit the specific parameters. For example, input parameter A outputs the original sorting mode; input parameter B outputs the overall sorting mode; input parameter C outputs the partial sorting mode. If the user does not specify parameters, the sorting mode provided in this embodiment will not be used when executing statements.
[0055] S120. Sort the row data identifiers in the query table according to the sorting pattern to obtain the target sorting result.
[0056] In this embodiment, the row data identifier is either a clustered key value or a row number. The clustered key value is a key value in the clustered index. In this embodiment, the clustered key values or row numbers in the query table can be sorted according to the sorting mode to obtain the target sorting result corresponding to the sorting mode. In this embodiment, for the sorting mode, a sorting operator can be added below the table lookup operator during the execution plan generation stage. Both the overall sorting mode and the partial sorting mode can have corresponding sorting operators. During the execution stage, after receiving the pre-set parameters input by the user, the row data identifiers in the query table can be sorted according to the sorting operator corresponding to the parameters. Below the table lookup operator can be the child layer of the table lookup operator. Taking the above query statement as an example, the parent layer of the table lookup operator is the PRJT2 operator, and the child layer of the table lookup operator is the SSEK2 operator. After adding the sorting operator, the child layer of the table lookup operator is the sorting operator, and the child layer of the sorting operator is the SSEK2 operator.
[0057] Optionally, the row data identifier codes in the query table are sorted according to the sorting mode to obtain a target sorting result, including: if the sorting mode is a raw sorting mode, the raw order of the row data identifier codes in the query table is taken as the sorting result; the sorting result is divided into one or more sorting sub-results; and the one or more sorting sub-results are taken as the target sorting result; if the sorting mode is a global sorting mode, the row data identifier codes in the query table are globally sorted to obtain a sorting result; the sorting result is divided into one or more sorting sub-results; and the one or more sorting sub-results are taken as the target sorting result; if the sorting mode is a local sorting mode, the row data identifier codes in the query table are divided into multiple groups; the row data identifier codes in each group are sorted respectively to obtain multiple sorting sub-results; or, the multiple sorting sub-results are combined into one sorting sub-result; and the one or more sorting sub-results are taken as the target sorting result.
[0058] Specifically, for the raw sorting mode, the sorting result is the raw order of the row data identifier codes in the query table; the sorting result can be divided into one or more sorting sub-results; and the one or more sorting sub-results are taken as the target sorting result. For the global sorting mode, the sorting result is the result of globally sorting the row data identifier codes in the query table once; the sorting result can be divided into one or more sorting sub-results; and the one or more sorting sub-results are taken as the target sorting result. For the local sorting mode, the sorting result includes multiple sorting sub-results, each of which is obtained by: dividing the row data identifier codes in the query table into multiple groups; and sorting the row data identifier codes in each group once to obtain multiple sorting sub-results. Or, the multiple sorting sub-results are combined into one sorting sub-result; and the one or more sorting sub-results are taken as the target sorting result.
[0059] In this embodiment, the aggregation key values or row numbers in the query table are sorted, which facilitates subsequent searching for corresponding data pages based on the sorted aggregation key values or row numbers, reduces the number of times of searching for data pages, and thus improves the efficiency of searching for data pages.
[0060] Further, the global sorting mode and the local sorting mode can make the target data belonging to the same data page appear continuously, thereby reducing the number of times of searching for data pages. However, the sorting operation itself can introduce additional overhead, and therefore, in a scenario where it is believed that good results can be achieved without additional sorting operation, the raw sorting mode can be selected.
[0061] S130, determining the data page where each row data identifier code is located according to the target sorting result.
[0062] In this embodiment, the target sorting result includes one set of sorting sub-results or multiple sets of sorting sub-results. If the target sorting result is one set of sorting sub-results, the data page where each aggregated key value or row number in the target sorting result is located can be determined in sequence according to the order of the target sorting result. If the target sorting result is multiple sets of sorting sub-results, for each set of sorting sub-results, the data page where each aggregated key value or row number in the corresponding set of sorting sub-results is located can be determined in sequence according to the order of the corresponding set of sorting sub-results, that is, the data page where the aggregated key value or row number in each set of sorting sub-results is located is determined respectively.
[0063] In this embodiment, the sorting operator can perform the following operation: sorting the row data identifier codes in the query table according to the sorting mode to obtain a target sorting result. The back table operator can perform the following operation: determining the data page where each row data identifier code is located according to the target sorting result. The sorting operator can pass one set of sorting sub-results or multiple sets of sorting sub-results to the back table operator, and the back table operator takes the one set of sorting sub-results or the multiple sets of sorting sub-results as the target sorting result. If it is a local sorting mode, the back table operator can also sort the row data identifier codes in each set once to obtain multiple sets of sorting sub-results, and take the multiple sets of sorting sub-results as the target sorting result.
[0064] Optionally, determining the data page where each row data identifier code is located according to the target sorting result includes: if the target sorting result is one set of sorting sub-results, determining the data page where the row data identifier code in the target sorting result is located; and if the target sorting result is multiple sets of sorting sub-results, determining the data page where the row data identifier code in each set of sorting sub-results is located in sequence according to the order of the multiple sets of sorting sub-results.
[0065] In this embodiment, the target sorting result corresponding to the global sorting mode, the original sorting mode and the local sorting mode can have two ways to determine the data page where the row data identifier code is located. The first way: if the target sorting result is multiple sets of sorting sub-results, the data page where the row data identifier code in each set of sorting sub-results is located is determined in sequence according to the order of the multiple sets of sorting sub-results, that is, the sorting result is divided into multiple batches, and the data page where the row data identifier code in each set of sorting sub-results is located is determined in sequence according to the order of the batches. The way to determine the data page where the row data identifier code in each batch is located can be the same. The second way: if the target sorting result is one set of sorting sub-results, the data page where the row data identifier code in the target sorting result is located can be determined at one time.
[0066] In the embodiment, for any one of the sorting modes, if the target sorting result is a plurality of sorting sub-results, the way of sequentially determining the data pages where the row data identification codes in the plurality of sorting sub-results are located according to the order of the plurality of sorting sub-results can avoid sending a large amount of target data to the parent operator at one time, and improve the speed of data query.
[0067] Optionally, the sequentially determining the data pages where the row data identification codes in the plurality of sorting sub-results are located includes: for each sorting sub-result, taking the first row data identification code in the sorting sub-result as a current row data identification code; determining a first data page where the current row data identification code is located; and determining the data pages where the row data identification codes in the sorting sub-result are located according to the first data page.
[0068] In the embodiment, the way of determining the data pages where the row data identification codes in each sorting sub-result are located is the same. For any one of the sorting sub-results, the first row data identification code in the sorting sub-result is taken as a current row data identification code; a first data page where the current row data identification code is located is determined; and the data pages where the remaining row data identification codes in the sorting sub-result are located are determined according to the first data page. In the embodiment, the way of determining the data pages where the remaining row data identification codes in the sorting sub-result are located according to the first data page where the first row data identification code in the sorting sub-result is located can reduce the number of repeated searching of data pages.
[0069] Optionally, the determining the data pages where the row data identification codes in the sorting sub-result are located according to the first data page includes: determining a first range corresponding to the row data identification codes in the first data page; sequentially judging whether the row data identification codes in the sorting sub-result fall into the first range according to the order of the sorting sub-result; if the row data identification codes fall into the first range, taking the first data page as the data page of the row data identification codes in the sorting sub-result; if the row data identification codes do not fall into the first range, taking the row data identification codes that do not fall into the first range as new current row data identification codes; taking the data page where the new current row data identification codes are located as a new first data page; and determining the data pages where the remaining row data identification codes in the sorting sub-result are located according to the new first data page.
[0070] The first range can be a range corresponding to all row data identification codes in the first data page. Specifically, in order, it is judged whether the remaining row data identification codes in the sorting sub-result fall into the first range according to the order of the sorting sub-result; if the remaining row data identification codes fall into the first range, the first data page is taken as the data page corresponding to the row data identification codes, and there is no need to re-search the data page; if the remaining row data identification codes do not fall into the first range, the row data identification codes not falling into the first range are taken as new current row data identification codes; the data page in which the new current row data identification codes are located is taken as a new first data page; the data page in which the remaining row data identification codes in the sorting sub-result are located is determined according to the new first data page, until the data page in which all row data identification codes in the sorting sub-result are located is determined.
[0071] In the embodiment, the first data page is taken as the data page of the row data identification codes falling into the first range, the row data identification codes not falling into the first range are taken as new current row data identification codes, and the data page in which the remaining row data identification codes in the sorting sub-result are located is determined according to the data page corresponding to the current row data identification codes, so that the number of times of searching the data page can be effectively reduced, and the query efficiency of the table query can be improved.
[0072] Optionally, the data page in which the remaining row data identification codes in the sorting sub-result are located is determined according to the new first data page, including: determining a second range corresponding to the row data identification codes in the new first data page; taking the second range as a new first range; starting from the new row data identification codes, it is continued to judge whether the remaining row data identification codes in the sorting sub-result fall into the new first range, until the data page in which all row data identification codes in the sorting sub-result are located is determined.
[0073] Specifically, if the remaining row data identification codes do not fall into the first range, the row data identification codes not falling into the first range are taken as new current row data identification codes; the data page in which the new current row data identification codes are located is taken as a new first data page, and the second range corresponding to the new first data page is taken as a new first range. Starting from the new row data identification codes, it is continued to judge whether the remaining row data identification codes in the sorting sub-result fall into the new first range, until the data page in which all row data identification codes in the sorting sub-result are located is determined.
[0074] In the embodiment, the row data identifier code not falling into the first range is taken as a new current row data identifier code, a data page corresponding to the current row data identifier code is taken as a new first data page, a second range corresponding to the new first data page is taken as a new first range, and the mode of continuously judging whether the remaining row data identifier codes in the sorting sub-result fall into the new first range from the new row data identifier code is continued, so that the data page where the row data identifier code in the sorting sub-result is located is determined according to the first data page, the number of times of searching for the data page can be effectively reduced, and the query efficiency of the table lookup query is improved.
[0075] Optionally, the first range of the row data identifier code in the first data page is determined, and the method comprises the following steps.
[0076] The starting row data identifier code and the ending row data identifier code in the first data page are determined, and the first range corresponding to the starting row data identifier code and the ending row data identifier code is determined.
[0077] Specifically, the first range corresponding to the first data page can be determined by the starting row data identifier code and the ending row data identifier code in the first data page, and the new first range corresponding to the new first data page can be determined by the starting row data identifier code and the ending row data identifier code in the new first data page.
[0078] Optionally, the data page where the row data identifier code in the target sorting result is located is determined, and the method comprises the following steps.
[0079] In the embodiment, the data page where the row data identifier code in the target sorting result is located is determined in one time, and the method comprises the following steps: taking the first row data identifier code in the target sorting result as a current row data identifier code; determining a second data page where the current row data identifier code is located; determining a third range corresponding to the row data identifier code in the second data page; judging whether the row data identifier code in the target sorting result falls into the third range in sequence according to the sequence of the target sorting result; if the row data identifier code falls into the third range, taking the second data page as the data page of the row data identifier code in the target sorting result; if the row data identifier code does not fall into the third range, taking the row data identifier code not falling into the third range as a new current row data identifier code; taking the data page where the new current row data identifier code is located as a new second data page; and determining the data page where the remaining row data identifier codes in the target sorting result are located according to the new second data page.
[0080] In the embodiment, in the case of small data volume, the efficiency of the table lookup query can be improved by determining the data page where the row data identifier code in the target sorting result is located in one time.
[0081] S140, extracting the target data corresponding to the row data identifier code in the data page.
[0082] In this embodiment, since the data in the database is actually stored in the data page, after the data page corresponding to the row data identifier code in the target sorting result is determined, the corresponding target data can be located in the data page, i.e., the corresponding complete record is located.
[0083] Optionally, the extracting the target data corresponding to the row data identifier code in the data page comprises: extracting the target data corresponding to the row data identifier code in the sorting sub-result in the data page.
[0084] Optionally, after the target data corresponding to the row data identifier code in the data page is extracted, the method further comprises:
[0085] uploading all the target data to the parent operator of the table-valued function operator.
[0086] In this embodiment, if the following method is used: the sorting result is divided into multiple sorting sub-results; and the data pages in which the row data identifier codes in the multiple sorting sub-results are located are determined in sequence according to the order of the multiple sorting sub-results, after the data pages in which all the row data identifier codes in any one sorting sub-result are located are determined, the target data corresponding to the row data identifier codes in the sorting sub-result can be extracted in the corresponding data page, and the target data corresponding to the sorting sub-result is uploaded to the parent operator of the table-valued function operator. That is, after the target data corresponding to the row data identifier codes in the sorting sub-result is extracted in the data page, the method further comprises: uploading the target data to the parent operator of the table-valued function operator. That is, the target data is uploaded to the parent operator of the table-valued function operator in multiple batches.
[0087] Optionally, the extracting the target data corresponding to the row data identifier code in the data page comprises: extracting the target data corresponding to the row data identifier code in the target sorting result in the data page.
[0088] Optionally, after the target data corresponding to the row data identifier code in the data page is extracted, the method further comprises:
[0089] uploading all the target data to the parent operator of the table-valued function operator.
[0090] If the one-time determination of the data page where the row data identifier code in the target sorting result is located is adopted in this embodiment, after the data page where all the row data identifier codes in the target sorting result are located is determined, the target data corresponding to the row data identifier code in the target sorting result can be extracted from the corresponding data page, and all the target data corresponding to the target sorting result is uploaded to the parent operator of the table back operation operator. That is, after the target data corresponding to the row data identifier code in the target sorting result is extracted from the data page, the method further includes uploading all the target data to the parent operator of the table back operation operator. That is, the target data is uploaded to the parent operator of the table back operation operator at one time.
[0091] In the embodiment of the present disclosure, the sorting mode is determined based on the table back operation operator; the sorting mode includes an original sorting mode, an overall sorting mode and a local sorting mode; the row data identifier codes in the query table are sorted according to the sorting mode to obtain a target sorting result; the data page where each row data identifier code is located is determined according to the target sorting result; the target data corresponding to the row data identifier code is extracted from the data page; and the row data identifier code is an aggregate key value or a row number. In the embodiment of the present disclosure, the aggregate key value or the row number in the query table is sorted according to the sorting mode to obtain the target sorting result, and the data page where the aggregate key value or the row number is located is determined according to the target sorting result, which can reduce the number of times of searching the data page and improve the query efficiency of the table back query.
[0092] Figure 2 Another table back query method flowchart provided by the embodiment of the present disclosure is provided, and the specific steps are as follows:
[0093] S201, if the parameter corresponding to the table back operation operator input by the user is received, the sorting mode is determined according to the input parameter.
[0094] If the parameter corresponding to the table back operation operator input by the user is not received, the optimization scheme provided by the embodiment of the present disclosure is not used to execute the statement.
[0095] S202, if the sorting mode is the overall sorting mode, the row data identifier codes in the query table are sorted in an overall manner to obtain a sorting result; if the sorting mode is the original sorting mode, the original order of the row data identifier codes in the query table is taken as the sorting result; the sorting result is divided into one or more sorting sub-results; and the one or more sorting sub-results are taken as the target sorting result.
[0096] In the embodiment, in the plan generation stage, an additional sorting operator is added below the table returning operator. In the execution plan, the sorting operator sorts the row data identifiers in the query table as a whole, obtains a sorting result, divides the sorting result into one or more sorting sub-results, and inputs the one or more sorting sub-results as target sorting results to the table returning operator. If the original sorting mode or the local sorting mode is used, the plan generation stage does not perform additional processing, and generates the execution plan in the original manner. After the execution plan is successfully generated, the execution stage is entered. It should be noted that the S202 can also be placed in the execution stage, and the steps in the execution stage can also be placed in the plan generation stage. The embodiment does not limit this.
[0097] S203, when the table returning operator is executed, if the sorting mode is the local sorting mode, the row data identifiers in the query table are divided into multiple groups, each group of row data identifiers is sorted to obtain multiple sorting sub-results, or the multiple groups of sorting sub-results are combined into one group of sorting sub-results, and one group of sorting sub-results or multiple groups of sorting sub-results are used as target sorting results.
[0098] If the sorting mode is the original sorting mode or the whole sorting mode, the table returning operator does not need to perform additional sorting processing when executed, and S204 is executed.
[0099] S204, the table returning operator performs a table returning operation. If the target sorting result is multiple groups of sorting sub-results, a first row data identifier in a current sorting sub-result is used as a current row data identifier, and S205 is executed. If the target sorting result is one group of sorting sub-results, a first row data identifier in the target sorting result is used as a current row data identifier, and S208 is executed.
[0100] S205, according to the current row data identifier, a corresponding first data page is searched, a corresponding complete record in the first data page is obtained, and the complete record is filled into the to-be-output data.
[0101] S206, calculate the starting row data identifier code and the ending row data identifier code of the first data page, determine the first range corresponding to the starting row data identifier code and the ending row data identifier code; if the next row data identifier code in the sorting sub-result falls within the first range, take the first data page as the data page of the next row data identifier code; locate the corresponding complete record in the first data page, and fill it into the to-be-output data, continue to judge whether the next row data identifier code falls within the first range, until there is a row data identifier code that does not fall within the first range, or until all data of the current group is processed; if it does not fall within the first range, take the row data identifier code that does not fall within the first range as the new current row data identifier code; repeat S205 and S206 until the table returning operator processes all data of the current group, and execute S207.
[0102] S207, the table returning operator transmits the filled to-be-output data to the parent layer operator for execution, and continues to process the next group of sorting sub-results from S204 until all sorting sub-results are completed.
[0103] S208, according to the current row data identifier code, find the corresponding second data page, obtain the corresponding complete record in the second data page and fill it into the to-be-output data.
[0104] S209, determine the third range corresponding to the second data page; if the next row data identifier code in the target sorting result falls within the third range, take the second data page as the data page of the row data identifier code in the target sorting result; locate the corresponding complete record in the second data page, and fill it into the to-be-output data, continue to judge whether the next row data identifier code falls within the third range, until there is a row data identifier code that does not fall within the third range, or until all data in the target sorting result is processed; if it does not fall within the third range, take the row data identifier code that does not fall within the third range as the new current row data identifier code; repeat S208 and S209 until the table returning operator processes all data in the target sorting result, and execute S210.
[0105] S210, the table returning operator transmits the filled to-be-output data to the parent layer operator for execution.
[0106] As can be seen from the above specific steps, the difference between the overall sorting and the local sorting is that the overall sorting sends the sorted data to the table returning operator once or in batches (i.e., in groups) after the sorting operator sorts all data on the current operator; the local sorting sorts the data of the current batch (i.e., the current group) by the table returning operator. The efficiency of the two sorting modes is different in different scenarios, and the appropriate sorting mode needs to be selected according to the actual situation.
[0107] The technical solution provided by the embodiment aims to reduce the number of repeated data page searching, and the final optimization effect depends on whether the next row data identifier code can be directly positioned on the data page corresponding to the current row data identifier code in S206 or S209. The more data meeting the condition, the better the final optimization effect.
[0108] Figure 3 A structure diagram of a back table query device provided by the embodiment of the present disclosure is shown in FIG. 1. As shown in the figure, the device comprises a sorting mode determination module 310, a sorting module 320, a data page determination module 330 and a target data extraction module 340. Figure 3
[0109] The sorting mode determination module 310 is configured to determine a sorting mode based on a back table operator. The sorting mode comprises an original sorting mode, an overall sorting mode and a local sorting mode.
[0110] The sorting module 320 is configured to sort row data identifier codes in a query table according to the sorting mode, to obtain a target sorting result.
[0111] The data page determination module 330 is configured to determine a data page where each row data identifier code is located according to the target sorting result.
[0112] The target data extraction module 340 is configured to extract target data corresponding to the row data identifier code in the data page. The row data identifier code is an aggregate key value or a row number.
[0113] In the embodiment of the present disclosure, the sorting mode determination module determines a sorting mode based on a back table operator. The sorting mode comprises an original sorting mode, an overall sorting mode and a local sorting mode. The sorting module sorts row data identifier codes in a query table according to the sorting mode, to obtain a target sorting result. The data page determination module determines a data page where each row data identifier code is located according to the target sorting result. The target data extraction module extracts target data corresponding to the row data identifier code in the data page. The row data identifier code is an aggregate key value or a row number. In the embodiment of the present disclosure, the aggregate key value or the row number in the query table is sorted according to the sorting mode, to obtain a target sorting result, and the data page where the aggregate key value or the row number is located is determined according to the target sorting result. In this way, the number of searching data pages can be reduced, and the query efficiency of the back table query can be improved.
[0114] Optionally, the sorting module is specifically configured to: if the sorting mode is the original sorting mode, taking the original order of the row data identification codes in the query table as the sorting result; dividing the sorting result into one or more groups of sorting sub-results; taking the one or more groups of sorting sub-results as the target sorting result; if the sorting mode is the overall sorting mode, performing overall sorting on the row data identification codes in the query table to obtain the sorting result; dividing the sorting result into one or more groups of sorting sub-results; taking the one or more groups of sorting sub-results as the target sorting result; if the sorting mode is the local sorting mode, dividing the row data identification codes in the query table into multiple groups; performing sorting on the row data identification codes in each group respectively to obtain multiple groups of sorting sub-results; or, merging the multiple groups of sorting sub-results into one group of sorting sub-results; taking the one group of sorting sub-results or the multiple groups of sorting sub-results as the target sorting result.
[0115] Optionally, the data page determination module is specifically configured to: if the target sorting result is one group of sorting sub-results, determining the data page where the row data identification codes in the target sorting result are located; if the target sorting result is multiple groups of sorting sub-results, determining the data page where the row data identification codes in the multiple groups of sorting sub-results are located in turn according to the order of the multiple groups of sorting sub-results.
[0116] Optionally, the data page determination module is further configured to: for each group of sorting sub-results, taking the first row data identification code in the sorting sub-result as a current row data identification code; determining a first data page where the current row data identification code is located; determining the data page where the row data identification codes in the sorting sub-result are located according to the first data page.
[0117] Optionally, the target data extraction module is specifically configured to: extracting the target data corresponding to the row data identification codes in the sorting sub-result in the data page.
[0118] Optionally, the data page determination module is further configured to: determining a first range corresponding to the row data identification codes in the first data page; judging whether the row data identification codes in the sorting sub-result fall into the first range in turn according to the order of the sorting sub-results; if falling into the first range, taking the first data page as the data page of the row data identification codes in the sorting sub-result; if not falling into the first range, taking the row data identification codes not falling into the first range as a new current row data identification code; taking the data page where the new current row data identification code is located as a new first data page; and determining the data page where the remaining row data identification codes in the sorting sub-result are located according to the new first data page.
[0119] Optionally, the data page determination module is further configured to: determine the starting row data identifier code and the ending row data identifier code within the first data page; and determine the first range corresponding to the starting row data identifier code and the ending row data identifier code.
[0120] Optionally, the data page determination module is further configured to: determine the second range corresponding to the row data identifier code within the new first data page; use the second range as the new first range; starting from the new row data identifier code, continue to sequentially determine whether the remaining row data identifier codes in the sorting sub-result fall within the new first range, until the data page where all row data identifier codes in the sorting sub-result are located is determined.
[0121] Optionally, the data page determination module is further configured to: use the first row data identifier code in the target sorting result as the current row data identifier code; determine the second data page where the current row data identifier code is located; and determine the data page where the row data identifier code in the target sorting result is located based on the second data page;
[0122] Optionally, the target data extraction module is also used to: extract the target data corresponding to the row data identifier code in the target sorting result from the data page.
[0123] Optionally, the above device further includes an upload module, which is specifically used to upload all target data to the parent operator of the table lookup operator.
[0124] The table lookup device provided in this disclosure can execute the table lookup method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the method execution.
[0125] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0126] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 4 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 4 The diagram below shows the structure of the terminal device or server 400. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 4The electronic device shown is merely an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
[0127] As shown in Figure 4 The electronic device 400 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 402 or programs loaded into a random access memory (RAM) 403 from a storage device 408. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0128] In general, the following devices can be connected to the I / O interface 405: input devices 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 408 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 409. The communication devices 409 can allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 having various devices is shown, but it is understood that all the devices shown are not required to be implemented or provided. More or less devices can be alternatively implemented or provided.
[0129] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 409, or installed from the storage devices 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
[0130] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0131] The electronic device provided by the embodiments of the present disclosure and the hash query method provided by the above embodiments belong to the same inventive concept, and the technical details not described in detail in the present embodiments can be referred to the above embodiments, and the present embodiments have the same beneficial effects as the above embodiments.
[0132] The computer storage medium provided by the embodiments of the present disclosure stores a computer program, and the computer program is executed by a processor to implement the table query method provided by the above embodiments.
[0133] It should be noted that the computer readable medium of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, an RF (radio frequency) or the like, or any suitable combination of the above.
[0134] In some embodiments, the client, server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication (e.g., communication network) of any form or medium, such as a local area network ("LAN"), a wide area network ("WAN"), an internetwork (e.g., the Internet), and an end-to-end network (e.g., an ad hoc end-to-end network), as well as any currently known or future developed network.
[0135] The above computer readable medium can be included in the above electronic device; or can exist separately without being assembled into the electronic device.
[0136] The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to determine a sorting mode based on a table lookup operator; the sorting mode comprises a raw sorting mode, a global sorting mode and a local sorting mode; sort row data identification codes in a query table according to the sorting mode to obtain a target sorting result; determine a data page where each row data identification code is located according to the target sorting result; extract target data corresponding to the row data identification code in the data page; wherein the row data identification code is an aggregation key value or a row number.
[0137] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0138] The flow and block diagrams in the drawings show architectural, functional and operational architectures of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or combinations of hardware and software.
[0139] The units described in the embodiments of the present disclosure can be implemented in the form of software, or can be implemented in the form of hardware. In some cases, the names of the units do not constitute a limitation on the units themselves. For example, the first obtaining unit can also be described as a unit that obtains at least two Internet protocol addresses.
[0140] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0141] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0142] The above description is merely the preferred embodiments of the present disclosure and the explanation of the principles of the applied technology. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and also covers other technical solutions formed by any combinations of the above technical features or equivalent features without departing from the disclosed concept. For example, the above technical features can be replaced with the technical features disclosed in the present disclosure (but not limited to) that have similar functions to form technical solutions.
[0143] Moreover, while operations are depicted in a particular order, this should not be understood as requiring such an order nor infringing on the scope of the disclosure. Certain of the operations described in the discussion are combinable into a single operation, and certain operations can be separated into several operations. In some embodiments, the operations described in the discussion can be performed in an order different than presented in the discussion. In some embodiments, the operations described in the discussion can be performed concurrently. Also, while several specific implementation details are discussed in the discussion, these should not be interpreted as limiting the scope of the disclosure. Rather, certain features described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0144] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. A method of a table-valued query, characterized by, The method comprises the following steps: determining a sorting mode based on a table-based operator; the sorting mode comprises an original sorting mode, an overall sorting mode and a local sorting mode; sorting row data identifiers in a query table according to the sorting mode to obtain a target sorting result; determining a data page where each row data identifier is located according to the target sorting result; extracting target data corresponding to the row data identifier in the data page; the row data identifier is an aggregation key value or a row number; the step of determining a data page where each row data identifier is located according to the target sorting result comprises: if the target sorting result is a group of sorting sub-results, determining a data page where the row data identifier in the target sorting result is located; if the target sorting result is a plurality of groups of sorting sub-results, determining a data page where the row data identifier in the plurality of groups of sorting sub-results is located in turn according to the order of the plurality of groups of sorting sub-results; the step of determining a data page where the row data identifier in the target sorting result is located comprises: taking a first row data identifier in the target sorting result as a current row data identifier; determining a second data page where the current row data identifier is located; determining a data page where the row data identifier in the target sorting result is located according to the second data page; the step of determining a data page where the row data identifier in the plurality of groups of sorting sub-results is located in turn comprises: for each group of sorting sub-results, taking a first row data identifier in the sorting sub-result as a current row data identifier; determining a first data page where the current row data identifier is located; determining a data page where the row data identifier in the sorting sub-result is located according to the first data page; the step of determining a data page where the row data identifier in the sorting sub-result is located according to the first data page comprises: determining a first range corresponding to the row data identifier in the first data page; judging whether the row data identifier in the sorting sub-result falls within the first range in turn according to the order of the sorting sub-result; if the row data identifier falls within the first range, taking the first data page as the data page of the row data identifier in the sorting sub-result; if the row data identifier does not fall within the first range, taking the row data identifier not falling within the first range as a new current row data identifier; taking a data page where the new current row data identifier is located as a new first data page; determining a data page where the remaining row data identifier in the sorting sub-result is located according to the new first data page.
2. The method of claim 1, wherein, the step of sorting row data identifiers in a query table according to the sorting mode to obtain a target sorting result comprises: if the sorting mode is an original sorting mode, taking an original order of the row data identifiers in the query table as a sorting result; dividing the sorting result into one or more groups of sorting sub-results; taking the one or more groups of sorting sub-results as the target sorting result; if the sorting mode is an overall sorting mode, performing overall sorting on the row data identifiers in the query table to obtain a sorting result; dividing the sorting result into one or more groups of sorting sub-results; taking the one or more groups of sorting sub-results as the target sorting result. If the sorting mode is the local sorting mode, the row data identifier codes in the query table are divided into multiple groups; the row data identifier codes in each group are sorted respectively to obtain multiple groups of sorting sub-results; or the multiple groups of sorting sub-results are merged into one group of sorting sub-results; the one group of sorting sub-results or the multiple groups of sorting sub-results are taken as the target sorting result.
3. The method of claim 1, wherein, extracting target data corresponding to the row data identifier code in the data page comprises: if the target sorting result is the multiple groups of sorting sub-results, extracting target data corresponding to the row data identifier code in the sorting sub-result in the data page; if the target sorting result is the one group of sorting sub-results, extracting target data corresponding to the row data identifier code in the target sorting result in the data page.
4. The method of claim 1, wherein, determining a first range corresponding to the row data identifier code in the first data page comprises: determining a starting row data identifier code and a terminal row data identifier code in the first data page; determining a first range corresponding to the starting row data identifier code and the terminal row data identifier code.
5. The method of claim 1, wherein, determining the data page where the remaining row data identifier codes in the sorting sub-result are located according to the new first data page comprises: determining a second range corresponding to the row data identifier code in the new first data page; taking the second range as a new first range; starting from the new row data identifier code, continuing to judge whether the remaining row data identifier codes in the sorting sub-result fall within the new first range until the data pages where all the row data identifier codes in the sorting sub-result are located are determined.
6. The method of claim 1, wherein, after extracting the target data corresponding to the row data identifier code in the data page, further comprising: uploading all the target data to a parent operator of the table lookup operator.
7. A back table query apparatus, characterized by, comprising: a sorting mode determination module configured to determine a sorting mode based on the table lookup operator; the sorting mode comprises an original sorting mode, an overall sorting mode and a local sorting mode; a sorting module configured to sort row data identifier codes in a query table according to the sorting mode to obtain a target sorting result; a data page determination module configured to determine a data page where each row data identifier code is located according to the target sorting result; a target data extraction module configured to extract target data corresponding to the row data identifier code in the data page; wherein the row data identifier code is an aggregation key value or a row number; the data page determination module is specifically configured to: if the target sorting result is the one group of sorting sub-results, determine the data page where the row data identifier code in the target sorting result is located; if the target sorting result is the multiple groups of sorting sub-results, determine the data page where the row data identifier code in the multiple groups of sorting sub-results is located in sequence according to the order of the multiple groups of sorting sub-results; the data page determination module is further configured to: take a first row data identifier code in the target sorting result as a current row data identifier code; determine a second data page where the current row data identifier code is located; and determine the data page where the row data identifier code in the target sorting result is located according to the second data page. The data page determination module is further configured to: for each set of sorting sub-results, take the first row data identifier in the sorting sub-result as a current row data identifier; determine a first data page in which the current row data identifier is located; and determine data pages in which row data identifiers in the sorting sub-result are located according to the first data page; The data page determination module is further configured to: determine a first range corresponding to the row data identifier in the first data page; in sequence, judge whether the row data identifier in the sorting sub-result falls within the first range according to the order of the sorting sub-result; if the row data identifier falls within the first range, take the first data page as the data page of the row data identifier in the sorting sub-result; if the row data identifier does not fall within the first range, take the row data identifier that does not fall within the first range as a new current row data identifier; take the data page in which the new current row data identifier is located as a new first data page; and determine data pages in which remaining row data identifiers in the sorting sub-result are located according to the new first data page.
8. An electronic device, comprising: The electronic device includes: one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the table scan query method as claimed in any one of claims 1-6.
9. A storage medium containing computer executable instructions for performing the table scan query method as claimed in any one of claims 1-6 when executed by a computer processor.
Citation Information
Patent Citations
Table item management device and table item management method
CN104378295A
Distribution strategy adjustment method of global index, computer equipment and storage medium
CN113868242A