[go: up one dir, main page]

CN112162983A - Database index suggestion processing method, apparatus, medium and electronic equipment - Google Patents

Database index suggestion processing method, apparatus, medium and electronic equipment Download PDF

Info

Publication number
CN112162983A
CN112162983A CN202011001540.3A CN202011001540A CN112162983A CN 112162983 A CN112162983 A CN 112162983A CN 202011001540 A CN202011001540 A CN 202011001540A CN 112162983 A CN112162983 A CN 112162983A
Authority
CN
China
Prior art keywords
index
optimized
information
clause
suggestion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011001540.3A
Other languages
Chinese (zh)
Other versions
CN112162983B (en
Inventor
尹强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingbase Information Technologies Co Ltd
Original Assignee
Beijing Kingbase Information Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202011001540.3A priority Critical patent/CN112162983B/en
Publication of CN112162983A publication Critical patent/CN112162983A/en
Application granted granted Critical
Publication of CN112162983B publication Critical patent/CN112162983B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries

Landscapes

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

Abstract

The present disclosure relates to a database index suggestion processing method, apparatus, medium, and electronic device, wherein the method comprises: when the SQL sentence to be optimized is executed to the query optimization stage, optimizing the preset query clause, capturing and recording indexable information corresponding to the preset query clause; establishing an optimization index suggestion for the SQL statement to be optimized based on the indexable information; and creating a hypothesis index based on the optimization index suggestion, and determining the performance improvement yield of the SQL statement to be optimized based on the hypothesis index. According to the scheme, different optimization index suggestions can be created based on different preset query clauses, the range of the index suggestions is wide, the quantitative performance improvement yield can be calculated, the content of the index suggestions is richer, and by introducing the hypothesis indexes, time and resources are saved when the index suggestions are created and the yield is calculated, so that the performance of the database is integrally improved, meanwhile, the time of manual analysis is saved, and the optimization processing efficiency of the index suggestions is improved.

Description

Database index suggestion processing method, device, medium and electronic equipment
Technical Field
The embodiment of the disclosure relates to the technical field of databases, in particular to a database index suggestion processing method, a database index suggestion processing device, a computer-readable storage medium and an electronic device for implementing the database index suggestion processing method.
Background
Before executing a structured query language SQL statement, a database typically undergoes lexical analysis, syntax analysis, semantic analysis, query rewriting, and query optimization, as well as generating an execution plan and executing several stages. Therefore, the SQL sentences can be executed more efficiently, and the database resources are saved so as to improve the performance of the database.
Creating a reasonable index is one of the key factors that improve database performance. An index is a structure that sorts one or more columns of values in a database table, and the index can be used to quickly access specific information in the database table.
However, the database index is generally created manually at present, and the technical ability of a database administrator is tested. Therefore, some databases provide index suggestions, but the range of suggestions is still limited, resulting in a limited degree of improvement in database performance, and thus further improvement in database performance is desired. In addition, at present, it is difficult or even impossible to effectively evaluate how much performance benefit can be brought to the SQL statement to be optimized by the created index suggestion, so that it is difficult to quantitatively analyze the influence of the created index suggestion on the database performance.
Disclosure of Invention
To solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides a method.
In a first aspect, an embodiment of the present disclosure provides a database index suggestion processing method, including:
when the SQL sentence to be optimized is executed to the query optimization stage, optimizing a preset query clause, and capturing and recording indexable information corresponding to the preset query clause;
based on the indexable information, establishing an optimized index suggestion for the SQL statement to be optimized;
and creating a hypothesis index based on the optimization index suggestion, and determining the performance improvement yield of the SQL statement to be optimized based on the hypothesis index.
In some embodiments of the present disclosure, the preset query clause includes one or more of a most valued clause, a ranking clause, a filtering condition, and a connection condition;
when the SQL sentence to be optimized is executed to the query optimization stage to optimize the preset query clause, the indexable information corresponding to the preset query clause is captured and recorded, and the method comprises the following steps:
when the preset query clause uses the index, respectively capturing and recording the corresponding most value indexable information, sequencing indexable information, filtering indexable information and connecting indexable information through an optimizer.
In some embodiments of the present disclosure, the creating an optimization index suggestion for the SQL statement to be optimized based on the indexable information includes:
for the most valued indexable information and the sequencing indexable information, the indexing system of the database creates an optimized index suggestion sentence based on the table name information and the column name information related to the extracted most valued clause and sequencing clause;
for the filtering indexable information and the connection indexable information, querying to determine whether an index system of the database supports operators related to the filtering conditions and the connection conditions; and if so, creating an optimized index suggestion sentence by the index system based on the table name information and the column name information related to the extracted filtering condition and connecting condition.
In some embodiments of the present disclosure, the indexing system of the database supports one or more of B-tree indexing, B + number indexing, hash indexing; the most valued clause includes a MAX clause/MIN clause.
In some embodiments of the present disclosure, the creating a hypothesis index based on the optimized index suggestion includes:
creating a system hypothesis index table in a memory;
storing meta information of the hypothetical index in the system hypothetical index table, the meta information including one or more of an index name, an index type, a table object identifier, a number of index columns, an index column name, an index column type, and an index operator.
In some embodiments of the present disclosure, the determining a performance improvement yield of the SQL statement to be optimized based on the hypothesis index includes:
estimating a first total cost of the original execution plan of the SQL statement to be optimized;
configuring the hypothesis indexes in the original execution plan to form an optimized execution plan;
estimating a second total cost of the optimized execution plan, and determining the profitability based on the first total cost and the second total cost.
In some embodiments of the present disclosure, the determining the rate of return based on the first total cost and the second total cost includes:
determining a difference value of the first total cost minus a second total cost;
and dividing the difference value by the first total cost to obtain a percentage value as the yield.
In some embodiments of the disclosure, configuring the hypothesis index into the original execution plan to form an optimized execution plan includes:
acquiring meta information of the hypothesis index; the meta information comprises one or more of index name, index type, table object identifier, index column number, index column name, index column type and index operator;
and when the optimizer constructs an index list for the table related to the SQL statement to be optimized, filling the meta information of the hypothetical index into the candidate index list.
In some embodiments of the present disclosure, further comprising:
before estimating a second total cost of the optimized execution plan, acquiring the number of index tuples of the hypothetical index, the total number of pages of the index and the hierarchical depth of the index;
estimating the second total cost based on the number of index tuples, the total number of pages indexed, and the hierarchical depth of the index.
In a second aspect, an embodiment of the present disclosure provides a database index suggestion processing apparatus, including:
the acquisition and recording module is used for acquiring and recording indexable information corresponding to a preset query clause when the SQL sentence to be optimized is executed to the query optimization stage and the preset query clause is optimized;
the index suggestion creating module is used for creating an optimized index suggestion for the SQL statement to be optimized based on the indexable information;
and the profit calculation module is used for creating a hypothesis index based on the optimization index suggestion and determining the performance improvement profit rate of the SQL statement to be optimized based on the hypothesis index.
In a third aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the database index suggestion processing method according to any one of the embodiments.
In a fourth aspect, an embodiment of the present disclosure provides an electronic device, including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the steps of the database index suggestion processing method of any of the above embodiments via execution of the executable instructions.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
in the embodiment of the disclosure, when the SQL sentence to be optimized is executed to the query optimization stage to optimize the preset query clause, the indexable information corresponding to the preset query clause is captured and recorded, and then an optimized index suggestion is created for the SQL sentence to be optimized based on the indexable information; finally, a hypothesis index can be created based on the optimization index suggestion, and the performance improvement yield of the SQL statement to be optimized is determined based on the hypothesis index. Therefore, the scheme of the embodiment can create different optimization index suggestions based on different preset query clauses, the range of the index suggestions is wide, the quantitative performance improvement yield can be calculated, the content of the index suggestions is richer, database managers can conveniently refer to the index suggestions to adjust and optimize the performance of the database, the assumed indexes are introduced, time and resources are saved when the index suggestions are created and the yield is calculated, the performance of the database is further improved to a certain degree integrally, the time of manual analysis is saved at the same time, and the optimization processing efficiency of the index suggestions is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a flow chart of a database index suggestion processing method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a database index suggestion processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a database indexing suggestion process record data according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a database index suggestion processing apparatus according to an embodiment of the disclosure;
fig. 5 is a schematic diagram of an electronic device for implementing a database index suggestion processing method according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Some terms referred to in the embodiments of the present disclosure are explained first.
And index suggestion: for a given database and Structured Query Language (SQL) statements, the index suggestion DDL statement for creating the index is given, usually making the original SQL statement execute faster.
DDL: an abbreviation of Data Definition Language, Language for defining and managing all objects in the SQL database.
Fig. 1 is a flowchart of a database index suggestion processing method according to an embodiment of the present disclosure, where the database index suggestion processing method may include the following steps:
step S101: when the SQL sentence to be optimized is executed to the query optimization stage, the preset query clause is optimized, and the indexable information corresponding to the preset query clause is captured and recorded.
Step S102: and creating an optimization index suggestion for the SQL statement to be optimized based on the indexable information.
Step S103: and creating a hypothesis index based on the optimization index suggestion, and determining the performance improvement yield of the SQL statement to be optimized based on the hypothesis index.
The database index suggestion processing method of the embodiment can create different optimized index suggestions based on different preset query clauses, the range of the index suggestions is wide, the quantized performance improvement yield can be calculated, the content of the index suggestions is richer, the database performance can be adjusted and optimized by being convenient for a database administrator to refer to, by introducing the hypothesis indexes, time and resources are saved when the index suggestions are created and the yield is calculated, the performance of the database is further improved to a certain degree integrally, meanwhile, the time of manual analysis is saved, and the optimization processing efficiency of the index suggestions is improved.
Specifically, in step S101, when the SQL statement to be optimized is executed to the query optimization stage to optimize the preset query clause, the indexable information corresponding to the preset query clause is captured and recorded.
SQL statements in a database typically undergo lexical analysis, syntax analysis, semantic analysis, query rewriting and query optimization, as well as generating execution plans and executing several phases. For most databases, determining whether the index can be applied to the current SQL statement to be optimized is in the query optimization stage. The opportunity to capture indexable information for index suggestions is also in the query optimization stage. The indexable information corresponding to the preset query clause indicates that the database supports the usable index under the preset query clause.
For example, in some embodiments of the present disclosure, the preset query clause may include, but is not limited to, one or more of a most valued clause, an ordering (order) clause, a filtering (filter) condition, and a join (join) condition. The most valued clause may include a MAX clause/MIN clause. A join condition is a join operator from table to table. In this embodiment, after the SQL statement to be optimized is executed to the query optimization stage to optimize the preset query clause, when the preset query clause tries to use the index, the optimizer may capture and record the corresponding maximum indexable information, sorted indexable information, filtered indexable information, and connected indexable information, respectively. For example, the information of the capture record may be stored in the memory structure sys _ consistent _ condition table, and the recorded information may include query ID (queryid), suggestion type, suggestion column name, suggestion column ID, and the like related to the SQL statement to be optimized. Referring to fig. 3, three recorded SQL statements to be optimized and corresponding indexable information, i.e., indexable information, are captured, wherein the first SQL statement relates to FILTER (FILTER) indexable information, the second SQL statement relates to MIN/MAX indexable information, and the second SQL statement relates to ORDER (ORDER) indexable information.
Specifically, after entering the optimizer, the logic optimization is performed according to the original normal index processing flow, and the key steps may include a pull-up sub-query, a condition simplification, an external connection elimination, a selection operation push-down, and the like, which refer to the prior art and are not described herein again. Then, whether the clauses of the current SQL statement contain MIN clauses/MAX clauses is checked, and the following conditions can be specifically met: the current clause is the simplest SFW query, i.e. the target column only contains MIN or MAX aggregates, i.e. the clause does not contain group by, order by, multi-table join, subquery, window function, grouping set, cte, etc. When the condition is satisfied, the MIN/MAX indexable condition is recorded in the sys _ recammond _ condition table. It is also possible to check the order by clause (i.e., the FILTER clause) of the current clause and, if the current clause is a single table query and there is no group by clause, record the corresponding FILTER (FILTER) indexable the case into the sys _ recammond _ condition table. Or, the physical optimization can be processed according to the original flow, and when the scanning algorithm is selected for the table, the where condition and join condition on the table are recorded into the sys _ recammond _ condition table. This may end the indexable information capture process and obtain the indexable information indexable case recorded as shown in fig. 3.
In this embodiment, for the MIN clause/MAX clause, the index-able MIN/MAX information may be recorded in the original processing logic for determining whether the MIN/MAX clause can use the index. For the sorting clause, the information of the sorting sequence can be extracted for recording the indexable information of the sorting aiming at the sorting (order) clause. The condition that the sequencing statement comprises a plurality of lists is not supported, and the sequencing statement can be eliminated. For the filtering condition and the join condition, after all the original logic optimization is completed, the condition extraction record on the table is used for filtering the indexable information and the connection indexable information. Wherein if a preset query clause contains a plurality of table conditions, one condition of each table is recorded.
In step S102, an optimization index suggestion is created for the SQL statement to be optimized based on the indexable information.
Illustratively, in some embodiments of the present disclosure, for the most valued indexable information and the sorted indexable information, the indexing system of the database creates an optimized index proposal sentence based on the table name information and the column name information to which the extracted most valued clause and the sorted clause relate.
For example, the indexing system of the database may support one or more of a B-tree index, a B + number index, and a hash index, but is not limited thereto. In this embodiment, the supporting of the B-tree index is taken as an example for explanation. Specifically, for MIN/MAX indexable information and sorted indexable information, a B-tree (BTree) index may be used for optimization, for example, table names and column name information of records may be directly obtained to join an index proposal statement, so as to obtain an optimized index proposal statement DDL.
For the filtering indexable information and the connection indexable information, querying to determine whether an index system of the database supports operators related to the filtering conditions and the connection conditions; and if so, creating an optimized index suggestion sentence by the index system based on the table name information and the column name information related to the extracted filtering condition and connecting condition.
Specifically, for filtering indexable information and join indexable information, it is required to query whether the indexing system of the database supports relevant operators, such as a ">" operator, BTree index support, and HASH index support. Therefore, in this embodiment, the optimized index suggestion statement DDL may be created by the BTree index based on the extracted table name information and column name information related to the filter condition and join condition.
In a specific embodiment, as shown in fig. 3, the creating of the optimization index suggestion may include the following steps:
the method comprises the following steps: and opening a sys _ recommond _ condition table, and querying the indexable condition of each SQL statement to be optimized by taking the QueryID as a condition.
Step two: if the indexable condition record is empty, ending the current flow; otherwise, each indexable case record in the sys _ recurmond _ condition table is traversed.
Step three: if the current SQL statement records the MIN/MAX condition: extracting the table name and the column name, inquiring whether the btree index supports the type of the index current column or not for each involved column, and if so, splicing out an optimized index proposal sentence with the type such as 'create index idx _ tbl _ index _ a on tbl _ index using btree (a)'.
Step four: if the current record is a sort (ORDER) case: and extracting the table name and the column name, and inquiring whether the btree index supports the type of the current column of the index for each involved column. For unsupported columns, directly discard; for the supported columns, an optimized index suggestion statement like "create index idx _ tbl _ index _ a on tbl _ index using btree (a, b)" is uniformly spliced out.
Step five: if the current record is a FILTER (FILTER) condition and/or a join condition case: for each involved column, querying whether all index systems of the database support operators corresponding to the current conditions, and directly discarding the unsupported columns. For the supporting situation, continuously inquiring whether the index supported by the current database supports the index of the type, such as the type corresponding to the FILTER condition and the join condition. If yes, obtaining the table name and the column name which meet the two conditions, and uniformly splicing an optimized index suggestion statement such as 'create index idx _ tbl _ index _ a on tbl _ index using btree (a, b)'.
Step six: and recording the optimized index proposal sentences into the sys _ recurmond _ index view. The INDEX _ DDL column in FIG. 3 illustrates a specific optimized INDEX suggestion statement for three SQL statements.
In step S103, a hypothesis index is created based on the optimization index suggestion, and a performance improvement yield of the SQL statement to be optimized is determined based on the hypothesis index.
In this embodiment, after the optimized index suggestion statement is given, the index profitability can also be given together to help the user to make a decision to adjust the performance of the database more conveniently.
Specifically, in one embodiment, the creating of the hypothetical index based on the optimized index suggestion in step S103 includes the following steps:
step i) creating a system hypothesis index table in the memory.
Step ii) storing meta information of the hypothetical index in the system hypothetical index table, the meta information comprising one or more of an index name, an index type, a table object identifier, an index column number, an index column name, an index column type, an index operator.
For example, the hypothetical index may be used by the optimizer to evaluate the execution plan without actually creating the index. Specifically, an additional memory structure sys _ hypothetic _ index table may be created to store meta information of the hypothetical index, which may be encapsulated as a view for presentation. Assuming that the creation of the INDEX only stores the meta information, and does not generate data, the meta information is related to the above-mentioned optimized INDEX suggestion statement, and may include, for example, information such as an INDEX name, a table Object Identifier (OID), an INDEX column number, an INDEX column name, an INDEX column type, an INDEX operator, and an INDEX type obtained by the optimized INDEX suggestion statement shown in the INDEX _ DDL column in fig. 3.
Specifically, in an embodiment, with reference to fig. 2, the step of determining the performance improvement yield of the SQL statement to be optimized based on the hypothetical index in step S103 may specifically include the following steps:
step S201: and estimating a first total cost of the original execution plan of the SQL statement to be optimized.
Step S202: and configuring the hypothesis indexes in the original execution plan to form an optimized execution plan.
Step S203: estimating a second total cost of the optimized execution plan, and determining the profitability based on the first total cost and the second total cost.
In some embodiments of the present disclosure, configuring the hypothesis index in the original execution plan to form an optimized execution plan may specifically include: acquiring meta information of the hypothesis index; the meta information comprises one or more of index name, index type, table object identifier, index column number, index column name, index column type and index operator; and when the optimizer constructs an index list for the table related to the SQL statement to be optimized, filling the meta information of the hypothetical index into the candidate index list.
Index creation often takes much time and consumes much resources, so the hypothetical index is introduced in the embodiment. The assumption index is used by the optimizer to evaluate the execution plan without actually creating the index, and the specific method may be: an additional memory structure sys _ hypothetic _ index table is created to hold meta information of the hypothetical index, which can be encapsulated as a view for presentation. It is assumed that the creation of the index only holds meta information and does not produce data. The meta information may include an index name, a table Object Identifier (OID), an index column number, an index column name, an index column type, an index operator, an index type, and the like. For an explain statement, when the optimizer builds an index list for a table, the meta information of the hypothetical index may also be populated into the candidate index list. Subsequent operations of the optimizer thus treat the hypothetical index as a normal index.
According to the scheme of the embodiment, by introducing the hypothesis index, time and resources can be saved when the index suggestion is created and the yield is calculated, the processing efficiency is improved, meanwhile, the influence on the database can be reduced, and the performance of the database is improved.
In some embodiments of the present disclosure, the following steps may also be included: before estimating a second total cost of the optimized execution plan, acquiring the number of index tuples of the hypothetical index, the total number of pages of the index and the hierarchical depth of the index; estimating the second total cost based on the number of index tuples, the total number of pages indexed, and the hierarchical depth of the index.
For example, after the optimizer treats the hypothetical index as a normal index, additional processing may be performed during estimation, and the processing may be: the number of indexed tuples is estimated based on the table data and the associated selectivity function. The width of an index tuple is estimated based on the number of index columns and the data type of the index columns, and further the index element ancestor which can be borne by a page is estimated, so that the total page number contained in the index and the hierarchy depth of the index can be estimated, and the specific processing process can refer to the prior art. The cost can be estimated by using the hypothetical index as a normal index through the information. Through the processing steps, an optimized execution plan given by using the hypothesis index can be obtained.
The results of the original execution plan not using the hypothetical index and the optimized execution plan using the hypothetical index may then be formatted, e.g., json, and finally the total cost of the two execution plans may be extracted, and the profitability of the index may be calculated.
For example, in some embodiments of the present disclosure, the determining the profitability based on the first total cost before _ cost and the second total cost after _ cost may specifically include: determining a difference value of the first total cost before _ cost minus a second total cost after _ cost; and dividing the difference value by the first total cost before _ cost to obtain a percentage value as the yield. Obtaining an SQL statement execution plan cost before the creation of the optimized index suggestion, before _ cost, and obtaining an SQL statement execution plan cost after the creation of the optimized index suggestion: after _ cost.
Wherein, the profitability is (before _ cost-after _ cost)/before. As shown in fig. 3, the yield of 3 SQL statements is higher, and the performance of the database system is improved better.
In one specific example, assume that the index creation flow may include the following steps:
the method comprises the following steps: and starting the creation of the hypothesis index through a function interface by taking the query QueryID as an input.
Step two: and searching index creation statements of SQL statements to be optimized, and analyzing each index creation statement according to the original index creation flow.
Step three: the parsed result is stored in the sys _ hypothetic _ index table.
The hypothetical index cost evaluation flow may include the following steps:
the method comprises the following steps: obtaining an execution plan of an SQL statement to be optimized through an explain statement
Step two: and entering an optimizer logic optimization stage.
Step three: and at the MIN/MAX optimized position of the optimizer, searching whether the current SQL statement has a hypothesis index created for MIN/MAX, and if so, adding the hypothesis index into the candidate index list.
Step four: and entering an optimizer physical optimization stage.
When the optimizer selects an index algorithm for the table, whether the current SQL statement has a hypothesis index created for sorting is searched, and if yes, the hypothesis index is added into a candidate index list.
Step five: when the cost evaluation is carried out on the hypothesis indexes, a cost evaluation algorithm of the hypothesis indexes is introduced. The index tuple number is equal to the table tuple number, the index record width is the sum of the index column width and the tuple header, and the index tuple number, the total page number of the index and the hierarchy depth of the index which can be contained in one index page are further calculated. With this information, the cost evaluation of the index can be the same as that of the normal index.
Step six: and evaluating the execution plan to be performed according to the normal index by using the hypothesis index.
Step seven: an optimized execution plan that incorporates the hypothetical index is obtained.
The profitability assessment process may comprise the steps of:
the method comprises the following steps: and acquiring an execution plan of the SQL statement to be optimized through the explain statement, and extracting the total cost estimated by the execution plan as the cost of the original execution plan, wherein the total cost is named as before _ cost.
Step two: the hypothetical index is created based on the optimized index suggestion SQL statement.
Step three: and obtaining an optimized execution plan of the SQL statement to be optimized through the explain statement, and extracting the total cost estimated by the optimized execution plan as the cost of the optimized execution plan, wherein the cost is named as after _ cost.
Step four: by the formula: the profit rate is calculated as (before _ cost-after _ cost)/before _ cost, and can be updated in the view of sys _ recurmond _ index as shown in fig. 3.
Step five: and ending the income evaluation flow.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc. Additionally, it will also be readily appreciated that the steps may be performed synchronously or asynchronously, e.g., among multiple modules/processes/threads.
An embodiment of the present disclosure further provides a database index suggestion processing apparatus, as shown in fig. 4, the database index suggestion processing apparatus may include: the capturing and recording module 401 is configured to capture and record indexable information corresponding to a preset query clause when the SQL statement to be optimized is executed to optimize the preset query clause in the query optimization stage. An index suggestion creating module 402, configured to create an optimized index suggestion for the SQL statement to be optimized based on the indexable information. And the profit calculation module 403 is configured to create a hypothetical index based on the optimized index suggestion, and determine a performance improvement profit rate of the SQL statement to be optimized based on the hypothetical index.
The database index suggestion processing device of the embodiment can create different optimized index suggestions based on different preset query clauses, the range of the index suggestions is wide, and the quantized performance improvement yield can be calculated, so that the content of the index suggestions is richer, the database performance can be adjusted and optimized by being conveniently referred by a database administrator, and by introducing the hypothesis indexes, time and resources are saved when the index suggestions are created and the yield is calculated, the performance of the database is further improved to a certain degree integrally, meanwhile, the time of manual analysis is saved, and the optimization processing efficiency of the index suggestions is improved.
In some embodiments of the present disclosure, the preset query clause may include one or more of a most valued clause, a ranking clause, a filtering condition, and a join condition. When the SQL statement to be optimized is executed to the query optimization stage, and a preset query clause is optimized, the capturing and recording module 401 captures and records indexable information corresponding to the preset query clause, which may specifically include: when the preset query clause uses the index, respectively capturing and recording the corresponding most value indexable information, sequencing indexable information, filtering indexable information and connecting indexable information through an optimizer.
In some embodiments of the present disclosure, the index suggestion creating module 402 creates an optimized index suggestion for the SQL statement to be optimized based on the indexable information, which specifically includes: for the most valued indexable information and the sequencing indexable information, the indexing system of the database creates an optimized index suggestion sentence based on the table name information and the column name information related to the extracted most valued clause and sequencing clause; for the filtering indexable information and the connection indexable information, querying to determine whether an index system of the database supports operators related to the filtering conditions and the connection conditions; and if so, creating an optimized index suggestion sentence by the index system based on the table name information and the column name information related to the extracted filtering condition and connecting condition.
In some embodiments of the present disclosure, the indexing system of the database supports one or more of B-tree indexing, B + number indexing, hash indexing; the most valued clause includes a MAX clause/MIN clause.
In some embodiments of the present disclosure, the revenue calculation module 403 creates a hypothetical index based on the optimization index suggestion, and determines a performance improvement revenue rate of the SQL statement to be optimized based on the hypothetical index, which specifically includes: estimating a first total cost of the original execution plan of the SQL statement to be optimized; configuring the hypothesis indexes in the original execution plan to form an optimized execution plan; estimating a second total cost of the optimized execution plan, and determining the profitability based on the first total cost and the second total cost.
In some embodiments of the disclosure, the determining, by the profit calculation module 403, the profit margin based on the first total cost and the second total cost may specifically include: determining a difference value of the first total cost minus a second total cost; and dividing the difference value by the first total cost to obtain a percentage value as the yield.
In some embodiments of the disclosure, the configuring, by the benefit calculation module 403, the hypothesis index into the original execution plan to form an optimized execution plan may specifically include: acquiring meta information of the hypothesis index; the meta information comprises one or more of index name, index type, table object identifier, index column number, index column name, index column type and index operator; and when the optimizer constructs an index list for the table related to the SQL statement to be optimized, filling the meta information of the hypothetical index into the candidate index list.
In some embodiments of the present disclosure, the profit computation module 403 may be further configured to obtain the number of index tuples of the hypothetical index, the total number of pages of the index, and the hierarchical depth of the index before estimating the second total cost of the optimized execution plan; estimating the second total cost based on the number of index tuples, the total number of pages indexed, and the hierarchical depth of the index.
The specific manner in which the above-mentioned embodiments of the apparatus, and the corresponding technical effects brought about by the operations performed by the respective modules, have been described in detail in the embodiments related to the method, and will not be described in detail herein.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units. The components shown as modules or units may or may not be physical units, i.e. may be located in one place or may also be distributed over a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the wood-disclosed scheme. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the database index suggestion processing method according to any one of the embodiments.
By way of example, and not limitation, such readable storage media can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
The embodiment of the disclosure also provides an electronic device, which includes a processor and a memory, wherein the memory is used for storing the executable instruction of the processor. Wherein the processor is configured to perform the steps of the database index suggestion processing method in any of the above embodiments via execution of the executable instructions.
An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 5. The electronic device 600 shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the electronic device 600 is embodied in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 that connects the various system components (including the storage unit 620 and the processing unit 610), a display unit 640, and the like.
Wherein the storage unit stores program code executable by the processing unit 610 to cause the processing unit 610 to perform steps according to various exemplary embodiments of the present invention described in the database index suggestion processing method section above in this specification. For example, the processing unit 610 may perform the steps of the method as shown in fig. 1.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via the bus 630. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above database index suggestion processing method according to the embodiments of the present disclosure.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1.一种数据库索引建议处理方法,其特征在于,包括:1. a database index suggestion processing method, is characterized in that, comprises: 在待优化SQL语句执行至查询优化阶段优化预设查询子句时,捕获并记录所述预设查询子句对应的可索引信息;When the to-be-optimized SQL statement is executed to the query optimization stage and the preset query clause is optimized, the indexable information corresponding to the preset query clause is captured and recorded; 基于所述可索引信息,为所述待优化SQL语句创建优化索引建议;based on the indexable information, creating an optimized index suggestion for the to-be-optimized SQL statement; 基于所述优化索引建议创建假设索引,基于所述假设索引确定待优化SQL语句的性能改善收益率。A hypothetical index is created based on the optimized index suggestion, and the performance improvement rate of the SQL statement to be optimized is determined based on the hypothetical index. 2.根据权利要求1所述的数据库索引建议处理方法,其特征在于,所述预设查询子句包括最值子句、排序子句、过滤条件和连接条件中的一个或多个;2. The method for processing database index suggestions according to claim 1, wherein the preset query clause comprises one or more of a most value clause, a sorting clause, a filter condition and a join condition; 所述在待优化SQL语句执行至查询优化阶段优化预设查询子句时,捕获并记录所述预设查询子句对应的可索引信息,包括:When the to-be-optimized SQL statement is executed to the query optimization stage and the preset query clause is optimized, the indexable information corresponding to the preset query clause is captured and recorded, including: 在所述预设查询子句使用索引进行优化时,通过优化器分别捕获记录对应的最值可索引信息、排序可索引信息、过滤可索引信息和连接可索引信息。When the preset query clause is optimized by using an index, the most value indexable information, the sorting indexable information, the filtering indexable information and the connection indexable information corresponding to the records are captured by the optimizer respectively. 3.根据权利要求2所述的数据库索引建议处理方法,其特征在于,所述基于所述可索引信息,为所述待优化SQL语句创建优化索引建议,包括:3. The method for processing database index suggestions according to claim 2, wherein, based on the indexable information, creating an optimized index suggestion for the to-be-optimized SQL statement comprises: 对于所述最值可索引信息和排序可索引信息,所述数据库的索引系统基于提取的所述最值子句和排序子句涉及的表名信息和列名信息创建优化索引建议语句;For the most value indexable information and the sorting indexable information, the indexing system of the database creates an optimized index suggestion statement based on the table name information and column name information involved in the extracted most value clause and the sorting clause; 对于所述过滤可索引信息和连接可索引信息,查询确定所述数据库的索引系统是否支持与所述过滤条件和连接条件相关的操作符;若支持则由所述索引系统基于提取的所述过滤条件和连接条件涉及的表名信息和列名信息创建优化索引建议语句。For the filter indexable information and the connection indexable information, query to determine whether the indexing system of the database supports the operator related to the filter condition and the connection condition; if so, the indexing system based on the extracted filter The table name information and column name information involved in the condition and join condition create an optimized index suggestion statement. 4.根据权利要求3所述的数据库索引建议处理方法,其特征在于,所述数据库的索引系统支持B树索引、B+数索引、哈希索引中的一个或多个;所述最值子句包括MAX子句/MIN子句。4. The method for processing database index suggestions according to claim 3, wherein the index system of the database supports one or more of a B-tree index, a B+ number index, and a hash index; the most value clause Include MAX clause/MIN clause. 5.根据权利要求1~4任一项所述的数据库索引建议处理方法,其特征在于,所述基于所述优化索引建议创建假设索引,包括:The method for processing database index suggestions according to any one of claims 1 to 4, wherein the creating a hypothetical index based on the optimized index suggestion comprises: 在内存中创建系统假设索引表;Create system hypothetical index tables in memory; 在所述系统假设索引表中存储假设索引的元信息,所述元信息包括索引名称、索引类型、表对象标识符、索引列个数、索引列名、索引列类型、索引操作符中的一个或多个。Meta information of the hypothetical index is stored in the system hypothetical index table, where the meta information includes one of index name, index type, table object identifier, number of index columns, index column name, index column type, and index operator or more. 6.根据权利要求5所述的数据库索引建议处理方法,其特征在于,所述基于所述假设索引确定待优化SQL语句的性能改善收益率,包括:6. The database index suggestion processing method according to claim 5, wherein the determining the performance improvement rate of return of the SQL statement to be optimized based on the hypothetical index comprises: 估算所述待优化SQL语句的原始执行计划的第一总代价;Estimating the first total cost of the original execution plan of the SQL statement to be optimized; 将所述假设索引配置于所述原始执行计划中构成优化执行计划;configuring the hypothetical index in the original execution plan to constitute an optimized execution plan; 估算所述优化执行计划的第二总代价,基于所述第一总代价和第二总代价确定所述收益率。A second total cost of the optimized execution plan is estimated, and the yield is determined based on the first total cost and the second total cost. 7.根据权利要求6所述的数据库索引建议处理方法,其特征在于,所述基于所述第一总代价和第二总代价确定所述收益率,包括:7. The method for processing database index suggestions according to claim 6, wherein the determining the rate of return based on the first total cost and the second total cost comprises: 确定所述第一总代价减去第二总代价的差值;determining the difference between the first total cost and the second total cost; 将所述差值除以所述第一总代价得到的百分比值作为所述收益率。A percentage value obtained by dividing the difference by the first total cost is used as the yield. 8.根据权利要求6所述的数据库索引建议处理方法,其特征在于,所述将所述假设索引配置于所述原始执行计划中构成优化执行计划,包括:8 . The method for processing database index suggestions according to claim 6 , wherein configuring the hypothetical index in the original execution plan to constitute an optimized execution plan comprises: 8 . 获取所述假设索引的元信息;所述元信息包括索引名称、索引类型、表对象标识符、索引列个数、索引列名、索引列类型、索引操作符中的一个或多个;Obtain meta-information of the hypothetical index; the meta-information includes one or more of index name, index type, table object identifier, number of index columns, index column name, index column type, and index operator; 在优化器为待优化SQL语句涉及的表构建索引列表时,将所述假设索引的元信息填充至候选索引列表中。When the optimizer builds an index list for the table involved in the SQL statement to be optimized, the meta-information of the hypothetical index is filled into the candidate index list. 9.根据权利要求8所述的数据库索引建议处理方法,其特征在于,还包括:9. The method for processing database index suggestions according to claim 8, further comprising: 估算所述优化执行计划的第二总代价之前,获取所述假设索引的索引元组数、索引总的页面数和索引的层级深度;Before estimating the second total cost of the optimized execution plan, obtain the number of index tuples of the hypothetical index, the total number of pages of the index, and the level depth of the index; 基于所述索引元组数、索引总的页面数和索引的层级深度估算所述第二总代价。The second total cost is estimated based on the number of index tuples, the total number of pages indexed, and the hierarchical depth of the index. 10.一种数据库索引建议处理装置,其特征在于,包括:10. A database index suggestion processing device, characterized in that it comprises: 捕获记录模块,用以在待优化SQL语句执行至查询优化阶段优化预设查询子句时,捕获并记录所述预设查询子句对应的可索引信息;A capture and record module, configured to capture and record the indexable information corresponding to the preset query clause when the SQL statement to be optimized is executed to the query optimization stage to optimize the preset query clause; 索引建议创建模块,用于基于所述可索引信息,为所述待优化SQL语句创建优化索引建议;an index suggestion creation module, configured to create an optimized index suggestion for the to-be-optimized SQL statement based on the indexable information; 收益计算模块,用于基于所述优化索引建议创建假设索引,基于所述假设索引确定待优化SQL语句的性能改善收益率。A benefit calculation module, configured to create a hypothetical index based on the optimized index suggestion, and determine the performance improvement yield of the SQL statement to be optimized based on the hypothetical index. 11.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1~9任一项所述数据库索引建议处理方法的步骤。11 . A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the database index suggestion processing method according to any one of claims 1 to 9 are implemented. 12.一种电子设备,其特征在于,包括:12. An electronic device, characterized in that, comprising: 处理器;以及processor; and 存储器,用于存储所述处理器的可执行指令;a memory for storing executable instructions for the processor; 其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1~9任一项所述数据库索引建议处理方法的步骤。The processor is configured to execute the steps of the method for processing database index suggestions according to any one of claims 1 to 9 by executing the executable instructions.
CN202011001540.3A 2020-09-22 2020-09-22 Database index suggestion processing method, device, medium and electronic device Active CN112162983B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011001540.3A CN112162983B (en) 2020-09-22 2020-09-22 Database index suggestion processing method, device, medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011001540.3A CN112162983B (en) 2020-09-22 2020-09-22 Database index suggestion processing method, device, medium and electronic device

Publications (2)

Publication Number Publication Date
CN112162983A true CN112162983A (en) 2021-01-01
CN112162983B CN112162983B (en) 2024-12-06

Family

ID=73863157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011001540.3A Active CN112162983B (en) 2020-09-22 2020-09-22 Database index suggestion processing method, device, medium and electronic device

Country Status (1)

Country Link
CN (1) CN112162983B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817980A (en) * 2021-02-05 2021-05-18 腾讯科技(深圳)有限公司 Data index processing method, device, equipment and storage medium
CN113986933A (en) * 2021-09-03 2022-01-28 北京火山引擎科技有限公司 Materialized view creating method and device, storage medium and electronic equipment
CN114064719A (en) * 2021-11-12 2022-02-18 北京人大金仓信息技术股份有限公司 Data query method, data query device, electronic equipment, medium and program product
CN114510499A (en) * 2021-12-15 2022-05-17 阿里云计算有限公司 Execution efficiency optimization method and device for database operation statements
CN115237920A (en) * 2022-07-29 2022-10-25 平安科技(深圳)有限公司 Load-oriented data index recommendation method, device and storage medium thereof
CN115374121A (en) * 2022-08-26 2022-11-22 北京人大金仓信息技术股份有限公司 Database index generation method, machine-readable storage medium and computer equipment
CN115809268A (en) * 2022-11-23 2023-03-17 深圳计算科学研究院 Self-adaptive query method and device based on fragment index
CN116361265A (en) * 2023-03-03 2023-06-30 阿里云计算有限公司 Database storage optimization method, system, electronic device and storage medium
WO2023138665A1 (en) * 2022-01-24 2023-07-27 北京奥星贝斯科技有限公司 Query optimization method and apparatus for distributed database
CN116881219A (en) * 2023-06-09 2023-10-13 北京百度网讯科技有限公司 Database optimization processing method and device, electronic equipment and storage medium
CN117093611A (en) * 2023-10-16 2023-11-21 北京人大金仓信息技术股份有限公司 Database combined index suggestion processing method, storage medium and computer device
CN118132566A (en) * 2024-04-30 2024-06-04 深圳九有数据库有限公司 Database index optimization method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110055201A1 (en) * 2009-09-01 2011-03-03 Louis Burger System, method, and computer-readable medium for automatic index creation to improve the performance of frequently executed queries in a database system
US20130086038A1 (en) * 2011-09-30 2013-04-04 Bmc Software, Inc. Provision of index recommendations for database access
US20140095469A1 (en) * 2012-09-28 2014-04-03 Sap Ag Optimization of database query
US20160147751A1 (en) * 2014-11-25 2016-05-26 International Business Machines Corporation Generating an index for a table in a database background
US20180307715A1 (en) * 2017-04-20 2018-10-25 Servicenow, Inc. Index suggestion engine for relational databases
CN110909014A (en) * 2018-09-14 2020-03-24 阿里巴巴集团控股有限公司 Optimization suggestion generation and database query method, device, equipment and storage medium
CN111046040A (en) * 2019-11-26 2020-04-21 北京达佳互联信息技术有限公司 Method and device for determining index, electronic equipment and storage medium
US10747764B1 (en) * 2016-09-28 2020-08-18 Amazon Technologies, Inc. Index-based replica scale-out
CN111666279A (en) * 2020-04-14 2020-09-15 阿里巴巴集团控股有限公司 Query data processing method and device, electronic equipment and computer storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110055201A1 (en) * 2009-09-01 2011-03-03 Louis Burger System, method, and computer-readable medium for automatic index creation to improve the performance of frequently executed queries in a database system
US20130086038A1 (en) * 2011-09-30 2013-04-04 Bmc Software, Inc. Provision of index recommendations for database access
US20140095469A1 (en) * 2012-09-28 2014-04-03 Sap Ag Optimization of database query
US20160147751A1 (en) * 2014-11-25 2016-05-26 International Business Machines Corporation Generating an index for a table in a database background
US10747764B1 (en) * 2016-09-28 2020-08-18 Amazon Technologies, Inc. Index-based replica scale-out
US20180307715A1 (en) * 2017-04-20 2018-10-25 Servicenow, Inc. Index suggestion engine for relational databases
CN110909014A (en) * 2018-09-14 2020-03-24 阿里巴巴集团控股有限公司 Optimization suggestion generation and database query method, device, equipment and storage medium
CN111046040A (en) * 2019-11-26 2020-04-21 北京达佳互联信息技术有限公司 Method and device for determining index, electronic equipment and storage medium
CN111666279A (en) * 2020-04-14 2020-09-15 阿里巴巴集团控股有限公司 Query data processing method and device, electronic equipment and computer storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
戴健等: "DKR-Tree:一种支持动态关键字的空间对象索引树", 计算机研究与发展, 31 December 2013 (2013-12-31) *
昝汝涛等: ""军卫一号"门诊医师站重建数据库索引的设计与探讨", 实用医药杂志, 31 December 2016 (2016-12-31) *
魏威等: "基于索引的关系数据库查询优化", 洛阳大学学报, no. 02, 15 June 2007 (2007-06-15) *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817980A (en) * 2021-02-05 2021-05-18 腾讯科技(深圳)有限公司 Data index processing method, device, equipment and storage medium
CN112817980B (en) * 2021-02-05 2024-06-11 腾讯科技(深圳)有限公司 Data index processing method, device, equipment and storage medium
CN113986933A (en) * 2021-09-03 2022-01-28 北京火山引擎科技有限公司 Materialized view creating method and device, storage medium and electronic equipment
CN114064719A (en) * 2021-11-12 2022-02-18 北京人大金仓信息技术股份有限公司 Data query method, data query device, electronic equipment, medium and program product
CN114510499A (en) * 2021-12-15 2022-05-17 阿里云计算有限公司 Execution efficiency optimization method and device for database operation statements
WO2023138665A1 (en) * 2022-01-24 2023-07-27 北京奥星贝斯科技有限公司 Query optimization method and apparatus for distributed database
CN115237920A (en) * 2022-07-29 2022-10-25 平安科技(深圳)有限公司 Load-oriented data index recommendation method, device and storage medium thereof
CN115237920B (en) * 2022-07-29 2025-05-27 平安科技(深圳)有限公司 Load-oriented data index recommendation method and device, and storage medium
CN115374121A (en) * 2022-08-26 2022-11-22 北京人大金仓信息技术股份有限公司 Database index generation method, machine-readable storage medium and computer equipment
CN115809268A (en) * 2022-11-23 2023-03-17 深圳计算科学研究院 Self-adaptive query method and device based on fragment index
CN115809268B (en) * 2022-11-23 2024-01-16 深圳计算科学研究院 Adaptive query method and device based on fragment index
CN116361265A (en) * 2023-03-03 2023-06-30 阿里云计算有限公司 Database storage optimization method, system, electronic device and storage medium
CN116881219A (en) * 2023-06-09 2023-10-13 北京百度网讯科技有限公司 Database optimization processing method and device, electronic equipment and storage medium
CN117093611A (en) * 2023-10-16 2023-11-21 北京人大金仓信息技术股份有限公司 Database combined index suggestion processing method, storage medium and computer device
CN117093611B (en) * 2023-10-16 2024-03-19 北京人大金仓信息技术股份有限公司 Database combined index suggestion processing method, storage medium and computer device
CN118132566A (en) * 2024-04-30 2024-06-04 深圳九有数据库有限公司 Database index optimization method
CN118132566B (en) * 2024-04-30 2024-07-02 深圳九有数据库有限公司 Database index optimization method

Also Published As

Publication number Publication date
CN112162983B (en) 2024-12-06

Similar Documents

Publication Publication Date Title
CN112162983B (en) Database index suggestion processing method, device, medium and electronic device
US10642832B1 (en) Reducing the domain of a subquery by retrieving constraints from the outer query
CN113312377B (en) Automatic-association SQL query statement processing method and device and electronic equipment
US8332389B2 (en) Join order for a database query
Hueske et al. Opening the black boxes in data flow optimization
US8745033B2 (en) Database query optimization using index carryover to subset an index
US8965918B2 (en) Decomposed query conditions
CN111522816A (en) Data processing method, device, terminal and medium based on database engine
US9569485B2 (en) Optimizing database query
WO2017019879A1 (en) Multi-query optimization
US10754858B2 (en) Adaptive multi-index access plan for database queries
WO2009116028A2 (en) Method and apparatus for enhancing performance of database and environment thereof
CN109213826B (en) Data processing method and device
US20070214104A1 (en) Method and system for locking execution plan during database migration
CN120196631A (en) Database index optimization method and related equipment
CN111984625B (en) Database load characteristic processing method and device, medium and electronic equipment
CN116894022A (en) Leverage structured audit logs to improve the accuracy and efficiency of database audits
CN101405727B (en) Management of statistical views in a database system
CN115809268B (en) Adaptive query method and device based on fragment index
US20070208696A1 (en) Evaluating materialized views in a database system
JPWO2021044246A5 (en)
US7529729B2 (en) System and method for handling improper database table access
US20170177626A1 (en) Significant cleanse change information
EP1548612A1 (en) Method and device for providing column statistics for data within a relational database
KR100541531B1 (en) Query Processing Method through Path Subquery Conversion in Object-Oriented DBMS

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing

Applicant after: China Electronics Technology Group Jincang (Beijing) Technology Co.,Ltd.

Address before: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing

Applicant before: BEIJING KINGBASE INFORMATION TECHNOLOGIES Inc.

Country or region before: China

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant