WO2020259391A1 - 一种数据库脚本性能测试的方法及装置 - Google Patents
一种数据库脚本性能测试的方法及装置 Download PDFInfo
- Publication number
- WO2020259391A1 WO2020259391A1 PCT/CN2020/096905 CN2020096905W WO2020259391A1 WO 2020259391 A1 WO2020259391 A1 WO 2020259391A1 CN 2020096905 W CN2020096905 W CN 2020096905W WO 2020259391 A1 WO2020259391 A1 WO 2020259391A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- database
- abstract
- table information
- sentence
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/217—Database tuning
Definitions
- the embodiment of the present invention relates to the field of financial technology (Fintech), and in particular to a method and device for testing database script performance.
- the first one is for banks/financial institutions to simulate actual online production database data by calculating numbers in the test environment.
- the disadvantage of this scheme lies in the time cost of the number creation process, and it will inevitably increase the resource requirements of the test environment.
- the second is for banks/financial institutions to build a set of quasi-production environment database for performance testing through online production database data copies.
- the shortcomings of this solution are related to resource requirements.
- the database resource requirements of banks/financial institutions will double, resulting in a shortage of resources.
- the embodiment of the present invention provides a method and device for testing database script performance, which is used to save the manpower and resource expenses of manufacturing a test environment or preparing a quasi-production environment.
- an embodiment of the present invention provides a method for testing database script performance, including:
- the performance index of the database script is determined.
- the performance index of the database script is obtained, which is used to indicate the priority of determining the script optimization, which can save testing Human resources for environmental construction and reduction of resource expenditure for preparing quasi-production environment.
- the preprocessing of the statements in the database script information includes:
- the information related to the actual business in the sentence of the database script information is deleted.
- the consumption of the abstract sentence includes current consumption and estimated consumption
- the table information of the production database includes data volume information, index information, index discrimination information, and data growth trend
- table information of the test database Including data volume information, index information, index discrimination information, and data growth trends
- Determining the consumption of the abstracted statement according to the table information of the production database and/or the table information of the test database, the abstracted statement corresponding to the database script information, and the execution plan of the abstracted statement include:
- the plan is to determine the current consumption of abstract sentences in the table information of the production database; and combine the data growth trend in the table information of the production database to substitute estimated recent data statistics into the table information of the production database
- the execution plan of the abstraction statement determines the estimated consumption of the abstraction statement that exists in the table information of the production database
- the data volume information and/or index information and/or index discrimination degree in the table information of the test database corresponding to the abstract sentences in the table information of the production database are not present
- the information is converted according to a preset ratio, and the converted data volume information and/or index information and/or index discrimination information are substituted into the execution plan of the abstract statement that does not exist in the table information of the production database, and the non-existence is determined.
- the current consumption of abstract sentences that exist in the table information of the production database; and the data growth trend in the table information of the test database corresponding to the abstract sentences that do not exist in the table information of the production database is substituted into the estimated recent data statistics information
- the execution plan of the abstract sentence without the table information of the production database determines the estimated consumption of the abstract sentence without the table information of the production database.
- the determining the performance index of the database script according to the consumption of the abstraction sentence and the execution frequency of the abstraction sentence includes:
- a four-quadrant classification is performed to obtain the abstract sentence Performance.
- the method further includes:
- an embodiment of the present invention provides an apparatus for testing database script performance, including:
- the obtaining unit is used to obtain table information of the online production database, table information of the test database, and database script information in the test database test process;
- the processing unit is used to preprocess the sentences in the database script information to obtain the abstract sentences corresponding to the database script information; and determine the execution frequency of the abstract sentences; according to the table information of the production database And/or the table information of the test database, the abstraction sentence corresponding to the database script information, and the execution plan of the abstraction sentence, determine the consumption of the abstraction sentence;
- the execution frequency of the abstract statement determines the performance index of the database script.
- processing unit is specifically configured to:
- the information related to the actual business in the sentence of the database script information is deleted.
- the consumption of the abstract sentence includes current consumption and estimated consumption
- the table information of the production database includes data volume information, index information, index discrimination information, and data growth trend
- table information of the test database Including data volume information, index information, index discrimination information, and data growth trends
- the processing unit is specifically used for:
- the plan is to determine the current consumption of abstract sentences in the table information of the production database; and combine the data growth trend in the table information of the production database to substitute estimated recent data statistics into the table information of the production database
- the execution plan of the abstraction statement determines the estimated consumption of the abstraction statement that exists in the table information of the production database
- the data volume information and/or index information and/or index discrimination degree in the table information of the test database corresponding to the abstract sentences in the table information of the production database are not present
- the information is converted according to a preset ratio, and the converted data volume information and/or index information and/or index discrimination information are substituted into the execution plan of the abstract statement that does not exist in the table information of the production database, and the non-existence is determined.
- the current consumption of abstract sentences that exist in the table information of the production database; and the data growth trend in the table information of the test database corresponding to the abstract sentences that do not exist in the table information of the production database is substituted into the estimated recent data statistics information
- the execution plan of the abstract sentence without the table information of the production database determines the estimated consumption of the abstract sentence without the table information of the production database.
- processing unit is specifically configured to:
- a four-quadrant classification is performed to obtain the abstract sentence Performance.
- processing unit is further configured to:
- the execution frequency of the database script determines the optimization plan of the database script.
- an embodiment of the present invention also provides a computing device, including:
- Memory used to store program instructions
- the processor is configured to call the program instructions stored in the memory, and execute the above-mentioned database script performance test method according to the obtained program.
- embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions, which when the computer reads and executes the computer-readable instructions, cause the computer to execute the aforementioned database script performance Method of testing.
- FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present invention
- FIG. 2 is a schematic flowchart of a method for testing database script performance according to an embodiment of the present invention
- Figure 3 is a schematic diagram of a four-quadrant distribution provided by an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of an apparatus for testing database script performance provided by an embodiment of the present invention.
- FIG. 1 exemplarily shows a system architecture to which the embodiment of the present invention is applicable.
- the system architecture may be a server 100 used by a bank/financial institution for database script testing.
- the server 100 may include a database statistical information collection module 110, The script sentence capture module 120, the sentence analysis module 130, and the report management module 140.
- the database statistical information collection module 110 can collect database statistical information of banks/financial institutions, that is, table information, including table field information, data volume information, index information, index discrimination information, and data growth trends.
- the database statistical information collection module 110 can collect table information of an online production database of a bank/financial institution and table information of a test database.
- the script sentence capturing module 120 can capture the sentence information executed during the database test of the bank/financial institution in the test environment, abstract the captured sentences, classify and count the frequency.
- the sentence analysis module 130 can calculate sentence consumption in combination with the sentence execution plan and the database statistics of the bank/financial institution.
- the report management module 140 can perform four-quadrant classification based on the sentence frequency information and sentence consumption. And generate related statement performance test report.
- FIG. 1 is only an example, which is not limited in the embodiment of the present invention.
- FIG. 2 exemplarily shows the process of a method for testing database script performance provided by an embodiment of the present invention.
- the process can be executed by a database script performance testing device, which can be located in the above-mentioned bank/financial institution.
- the server 100 of the bank/financial institution may also be the server 100.
- the SQL database will be taken as an example, and the statements involved are SQL statements.
- the embodiment of the present invention is only an example, and is not limited to the SQL database.
- the process specifically includes:
- Step 201 Obtain table information of the online production database, table information of the test database, and database script information in the test database test process.
- the database statistical information collection module 110 can be used to collect table information of the online production database and collect table information of the test database.
- the script sentence capturing module 120 is used to capture the database script information during the test database test, and the script information includes a large amount of sentence information. It should be noted that when collecting the table information of the online generation database, the table information of the standby database of the production database can be collected.
- the table information may include table field information, data volume information, index information, index discrimination information, and data growth trends.
- Step 202 Preprocess the sentences in the database script information to obtain abstract sentences corresponding to the database script information; and determine the execution frequency of the abstract sentences.
- the script statement capturing module 120 After the script statement capturing module 120 captures the script information of the database, it can delete the information related to the actual business in the statement of the database script information, and retain the main information required for execution plan analysis, which is equivalent to abstracting the statement. For example, you can delete the numerical information in the where condition, so that the script only retains the main information needed for execution plan analysis, and the rest are abstract statements.
- the SQL script information captured by the script statement capturing module 120 may be as shown in Table 1.
- the elements that affect the execution plan of the SQL statement include the table name (or subquery) after the From keyword, the field information after the where condition and the order of the fields, and the simple after the Select keyword The field name (the most commonly used), the constant data after the set keyword in the Update statement and the constant data after the where keyword in the Update statement do not affect the execution plan. Then the data in Table 1 above is abstracted and preprocessed, The obtained SQL abstraction statement can be shown in Figure 4.
- the five abstract sentences shown in Table 2 can be grouped into one category, as shown in Table 3. After completing the SQL abstraction sentence classification, the execution frequency of the SQL abstraction sentence is counted according to the number of occurrences, and the SQL abstraction sentence and its execution frequency are registered in the table.
- Step 203 Determine the consumption of the abstract sentence according to the table information of the production database and/or the table information of the test database, the abstraction sentence corresponding to the database script information, and the execution plan of the abstraction sentence .
- the consumption of abstract sentences includes current consumption and estimated consumption.
- determining the consumption of the abstract sentence it can be specifically: for the abstract sentence that exists in the table information of the production database, substituting the data volume information and/or index information and/or index discrimination information in the table information of the production database into There is an execution plan for the abstract statement of the table information of the production database, and the current consumption of the abstract statement of the table information of the production database is determined. And combined with the data growth trend in the table information of the production database, the estimated recent data statistics information is substituted into the execution plan of the abstract statement of the table information of the production database, and the estimation of the abstract statement of the table information of the production database is determined. Consumption.
- the data volume information and/or index information and/or index discrimination information in the table information of the test database corresponding to the abstract statements in the table information of the production database are Perform conversion at a preset ratio, and substitute the converted data volume information and/or index information and/or index discrimination information into the execution plan of the abstract statement that does not exist in the production database table information, and determine that there is no production database table information The current consumption of abstract statements.
- the statement analysis module 130 can be used to analyze the execution plan of the SQL abstract statement, and execute the Explain command that comes with the SQL database on the SQL abstract statement in the test environment to obtain the execution plan of the SQL abstract statement running in the test environment. .
- the statistical information collected by the production database (content included in the table information) is substituted into the execution plan to calculate SQL consumption.
- the number of scanned rows in the execution plan is taken as the statistical latitude. SQL consumption statistics.
- the current consumption of the SQL abstraction statement can be calculated, combined with the data growth trend, the estimated recent data statistics are substituted into the execution plan, and the calculation Estimated consumption of SQL abstraction statements.
- the estimated recent data is based on the data in the historical table combined with data growth trends.
- the data volume information of the entire table substituted into the statistical data is used for consumption statistics.
- the data volume information of the entire table and the index discrimination information are converted into index data volume information for consumption statistics.
- the statistical data in the table information of the production database is as follows:
- the data volume in table a is 20000, and the growth trend is linear growth, with a periodical growth step of 3000;
- the data volume in the statistics of table b is 50000, because table b is a primary key index, the amount of scanned data is 1;
- the data volume of table c is 10000, and the increasing trend is that the statistical average value of the index discrimination degree of the first 8 bits of the tmpsno field is 1000, and the scanned data volume obtained by combining conversion is 10000/1000 about 10.
- the growth trend is a curve growth, and the slope change of the last few cycles is +0.15.
- SQL consumption is 20000+(1*3000)+(10000+10000*0.15)/1000, which is about 23012.
- the SQL consumption is 20000+(3*3000)+(10000*(1+0.15) ⁇ 3/1000) about 29015.
- the table information of the test database If there is no data in production, according to the table information of the test database, it is converted according to a certain preset ratio and substituted into the calculation of the consumption of the SQL abstraction statement (including current consumption and estimated consumption).
- the preset ratio can be set based on experience.
- Step 204 Determine the performance index of the database script according to the consumption of the abstract sentence and the execution frequency of the abstract sentence.
- the post-conversion consumption of abstract sentences can be determined according to the consumption and consumption threshold of abstract sentences, and the post-conversion consumption of abstract sentences can be determined according to the execution frequency and frequency threshold of abstract sentences. frequency.
- the four-quadrant classification is performed to obtain the performance indicators of abstract sentences.
- the performance index of abstract sentences is the content after four-quadrant classification. Among them, the current consumption and estimated consumption of abstract sentences are classified into four quadrants respectively.
- the consumption threshold and frequency threshold can be set based on experience.
- the SQL consumption in Table 2 is the consumption of SQL abstract statements.
- the four-quadrant classification of the data in Table 2 above can obtain the four-quadrant distribution of SQL consumption as shown in Figure 3.
- the SQL consumption value is a positive number that needs to be optimized, and the higher the frequency, the higher the optimization priority.
- an optimization plan for the database script can be determined based on the performance indicators of the database script, the characteristics of the database, the table information of the production database, the table information of the test database, and the execution frequency of the abstract statement.
- the report management module 140 is mainly used to provide the SQL script statement adjustment and optimization plan.
- the SQL script statement optimization has mature optimization implementation plans in the industry, and the optimization plan and business logic are relatively related.
- the embodiment of the present invention is based on the original optimization plan. On the basis of this, some special points related to the MYSQL database and the script sentence optimization proposal combined with statistical information are proposed.
- the field order of SQL database query conditions will affect the execution consumption of SQL statements.
- traverse the different sorting combinations in the query respectively count the consumption of SQL abstract statements, and select the lowest cost sorting method Mark as the best sort.
- Mark the involved non-optimal sorted SQL abstraction statement as a sorted optimized SQL statement.
- the index information in the basic statistical information of the database and the statistical information of the abstract sentence are obtained, and the secondary statistics are performed to obtain the fields in the query conditions corresponding to each table.
- the number of occurrences to determine whether the field has an index, index type, and the position of the field in the joint index are Count the fields corresponding to the frequently occurring tables. If the field has no index, it is marked as the field information that may need to be optimized.
- the report management module 140 can sort the analysis results and the SQL script sentence optimization plan, generate related SQL script sentence performance test reports, and submit it to the project team for SQL script sentence optimization.
- the priority during optimization can be high frequency high consumption, low frequency high consumption.
- the data growth trend information in the table information may not be collected, which can save the workload of the database statistical information collection module 110 and can only analyze the current consumption of the current current SQL statements. In this case, the estimated consumption of SQL statements cannot be achieved, and early warning cannot be given.
- the execution frequency of the above abstract statements may not be counted. In this case, it is only necessary to perform full optimization on the SQL abstract statements analyzed as high consumption.
- the embodiment of the present invention shows that by obtaining the table information of the online production database, the table information of the test database, and the database script information in the test process, the sentences in the database script information are preprocessed to obtain the abstract sentences corresponding to the database script information , And determine the execution frequency of the abstract statement, and determine the consumption of the abstract statement according to the table information of the production database and/or the table information of the test database, the abstract statement corresponding to the database script information, and the execution plan of the abstract statement.
- the consumption of abstract sentences and the execution frequency of the abstract sentences determine the performance index of the database script. Because the table information of the online production database and the table information of the test database are combined to perform the performance test of the database script, it can save the manpower and resource expenses of the test environment or the preparation of the quasi-production environment.
- database script performance test process in the embodiment of the present invention can be applied to various database script performance tests in banks/financial institutions.
- FIG. 4 exemplarily shows the structure of a database script performance test device provided by an embodiment of the present invention.
- the device can execute the process of database script performance test.
- the device can be located in the server 100. , Or the server 100.
- the device specifically includes:
- the obtaining unit 401 is configured to obtain table information of the online production database, table information of the test database, and database script information during the test database test process;
- the processing unit 402 is configured to preprocess the sentences in the database script information to obtain abstract sentences corresponding to the database script information; and determine the execution frequency of the abstract sentences; according to the table of the production database Information and/or the table information of the test database, the abstraction sentence corresponding to the database script information, and the execution plan of the abstraction sentence, determine the consumption of the abstraction sentence; according to the consumption sum of the abstraction sentence
- the execution frequency of the abstract sentence determines the performance index of the database script.
- processing unit 402 is specifically configured to:
- the information related to the actual business in the sentence of the database script information is deleted.
- the consumption of the abstract sentence includes current consumption and estimated consumption
- the table information of the production database includes data volume information, index information, index discrimination information, and data growth trend
- table information of the test database Including data volume information, index information, index discrimination information, and data growth trends
- the processing unit 402 is specifically configured to:
- the plan is to determine the current consumption of abstract sentences in the table information of the production database; and combine the data growth trend in the table information of the production database to substitute estimated recent data statistics into the table information of the production database
- the execution plan of the abstraction statement determines the estimated consumption of the abstraction statement that exists in the table information of the production database
- the data volume information and/or index information and/or index discrimination degree in the table information of the test database corresponding to the abstract sentences in the table information of the production database are not present
- the information is converted according to a preset ratio, and the converted data volume information and/or index information and/or index discrimination information are substituted into the execution plan of the abstract statement that does not exist in the table information of the production database, and the non-existence is determined.
- the current consumption of abstract sentences that exist in the table information of the production database; and the data growth trend in the table information of the test database corresponding to the abstract sentences that do not exist in the table information of the production database is substituted into the estimated recent data statistics information
- the execution plan of the abstract sentence without the table information of the production database determines the estimated consumption of the abstract sentence without the table information of the production database.
- processing unit 402 is specifically configured to:
- a four-quadrant classification is performed to obtain the abstract sentence Performance.
- processing unit 402 is further configured to:
- the execution frequency of the database script determines the optimization plan of the database script.
- an embodiment of the present invention also provides a computing device, including:
- Memory used to store program instructions
- the processor is configured to call the program instructions stored in the memory, and execute the above-mentioned database script performance test method according to the obtained program.
- the embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions.
- the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned database. Script performance testing method.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Debugging And Monitoring (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
| select*from student where class=’103’and name=’Tom’; |
| select name,score from student where class=’103’and name=’Tom’; |
| select name,score from student where class=’104’and name=’Juily’; |
| delete from student where class=’103’and name=’Tom’; |
| update student set score=’100’where class=’103’and name=’Tom’; |
| SQL抽象化语句编号 | 执行频次 | SQL消耗 | 转换后频次 | 转换后消耗 |
| 1 | 10 | 32000 | -490 | 12000 |
| 2 | 150 | 30 | -350 | -19970 |
| 3 | 350 | 4000 | -150 | -16000 |
| 4 | 40 | 4001 | -460 | -15999 |
| 5 | 280 | 4002 | -220 | -15998 |
| 6 | 60 | 4003 | -440 | -15997 |
| 7 | 5 | 4004 | -495 | -15996 |
| 8 | 80 | 4005 | -420 | -15995 |
| 9 | 23 | 4006 | -477 | -15994 |
| 10 | 100 | 4007 | -400 | -15993 |
| 11 | 110 | 50000 | -390 | 30000 |
| 12 | 730 | 48000 | 230 | 28000 |
| 13 | 750 | 5000 | 250 | -15000 |
| 14 | 770 | 15000 | 270 | -5000 |
| 15 | 770 | 3333 | 270 | -16667 |
| 16 | 899 | 52000 | 399 | 32000 |
Claims (12)
- 一种数据库脚本性能测试的方法,其特征在于,包括:获取线上生产数据库的表信息、测试数据库的表信息以及所述测试数据库测试过程中的数据库脚本信息;对所述数据库脚本信息中的语句进行预处理,得到所述数据库脚本信息对应的抽象化语句;并确定出所述抽象化语句的执行频次;根据所述生产数据库的表信息和/或所述测试数据库的表信息、所述数据库脚本信息对应的抽象化语句以及所述抽象化语句的执行计划,确定所述抽象化语句的消耗;根据所述抽象化语句的消耗和所述抽象化语句的执行频次,确定出所述数据库脚本的性能指标。
- 如权利要求1所述的方法,其特征在于,所述对所述数据库脚本信息中的语句进行预处理,包括:将所述数据库脚本信息的语句中的与实际业务相关的信息删除。
- 如权利要求1所述的方法,其特征在于,所述抽象化语句的消耗包括当前消耗和预估消耗;所述生产数据库的表信息包括数据量信息、索引信息、索引区分度信息、数据增长趋势;所述测试数据库的表信息包括数据量信息、索引信息、索引区分度信息、数据增长趋势;所述根据所述生产数据库的表信息和/或所述测试数据库的表信息、所述数据库脚本信息对应的抽象化语句以及所述抽象化语句的执行计划,确定所述抽象化语句的消耗,包括:对于存在生产数据库的表信息的抽象化语句,将生产数据库的表信息中的数据量信息和/或索引信息和/或索引区分度信息代入所述存在生产数据库的表信息的抽象化语句的执行计划,确定出所述存在生产数据库的表信息的抽象化语句的当前消耗;以及结合生产数据库的表信息中的数据增长趋势将预估的近期数据统计信息代入所述存在生产数据库的表信息的抽象化语句的 执行计划,确定出所述存在生产数据库的表信息的抽象化语句的预估消耗;对于不存在生产数据库的表信息的抽象化语句,将所述不存在生产数据库的表信息的抽象化语句对应的测试数据库的表信息中的数据量信息和/或索引信息和/或索引区分度信息按照预设比例进行转换,将转换后的数据量信息和/或索引信息和/或索引区分度信息代入所述不存在生产数据库的表信息的抽象化语句的执行计划,确定出所述不存在生产数据库的表信息的抽象化语句的当前消耗;以及结合所述不存在生产数据库的表信息的抽象化语句对应的测试数据库的表信息中的数据增长趋势将预估的近期数据统计信息代入所述不存在生产数据库的表信息的抽象化语句的执行计划,确定出所述不存在生产数据库的表信息的抽象化语句的预估消耗。
- 如权利要求1所述的方法,其特征在于,所述根据所述抽象化语句的消耗和所述抽象化语句的执行频次,确定出所述数据库脚本的性能指标,包括:根据所述抽象化语句的消耗和消耗阈值,确定出所述抽象化语句的转换后消耗;根据所述抽象化语句的执行频次和频次阈值,确定出所述抽象化语句的转换后频次;根据所述抽象化语句的消耗、所述抽象化语句的执行频次、所述抽象化语句的转换后消耗和所述抽象化语句的转换后频次,进行四象限分类,得到所述抽象化语句的性能指标。
- 如权利要求1至4任一项所述的方法,其特征在于,在所述确定出所述数据库脚本的性能指标之后,还包括:根据所述数据库脚本的性能指标、所述数据库的特征、所述生产数据库的表信息、所述测试数据库的表信息和所述抽象化语句的执行频次,确定出所述数据库脚本的优化方案。
- 一种数据库脚本性能测试的装置,其特征在于,包括:获取单元,用于获取线上生产数据库的表信息、测试数据库的表信息以 及所述测试数据库测试过程中的数据库脚本信息;处理单元,用于对所述数据库脚本信息中的语句进行预处理,得到所述数据库脚本信息对应的抽象化语句;并确定出所述抽象化语句的执行频次;根据所述生产数据库的表信息和/或所述测试数据库的表信息、所述数据库脚本信息对应的抽象化语句以及所述抽象化语句的执行计划,确定所述抽象化语句的消耗;根据所述抽象化语句的消耗和所述抽象化语句的执行频次,确定出所述数据库脚本的性能指标。
- 如权利要求6所述的装置,其特征在于,所述处理单元具体用于:将所述数据库脚本信息的语句中的与实际业务相关的信息删除。
- 如权利要求6所述的装置,其特征在于,所述抽象化语句的消耗包括当前消耗和预估消耗;所述生产数据库的表信息包括数据量信息、索引信息、索引区分度信息、数据增长趋势;所述测试数据库的表信息包括数据量信息、索引信息、索引区分度信息、数据增长趋势;所述处理单元具体用于:对于存在生产数据库的表信息的抽象化语句,将生产数据库的表信息中的数据量信息和/或索引信息和/或索引区分度信息代入所述存在生产数据库的表信息的抽象化语句的执行计划,确定出所述存在生产数据库的表信息的抽象化语句的当前消耗;以及结合生产数据库的表信息中的数据增长趋势将预估的近期数据统计信息代入所述存在生产数据库的表信息的抽象化语句的执行计划,确定出所述存在生产数据库的表信息的抽象化语句的预估消耗;对于不存在生产数据库的表信息的抽象化语句,将所述不存在生产数据库的表信息的抽象化语句对应的测试数据库的表信息中的数据量信息和/或索引信息和/或索引区分度信息按照预设比例进行转换,将转换后的数据量信息和/或索引信息和/或索引区分度信息代入所述不存在生产数据库的表信息的抽象化语句的执行计划,确定出所述不存在生产数据库的表信息的抽象化语句的当前消耗;以及结合所述不存在生产数据库的表信息的抽象化语句对应的测试数据库的表信息中的数据增长趋势将预估的近期数据统计信息代入所 述不存在生产数据库的表信息的抽象化语句的执行计划,确定出所述不存在生产数据库的表信息的抽象化语句的预估消耗。
- 如权利要求6所述的装置,其特征在于,所述处理单元具体用于:根据所述抽象化语句的消耗和消耗阈值,确定出所述抽象化语句的转换后消耗;根据所述抽象化语句的执行频次和频次阈值,确定出所述抽象化语句的转换后频次;根据所述抽象化语句的消耗、所述抽象化语句的执行频次、所述抽象化语句的转换后消耗和所述抽象化语句的转换后频次,进行四象限分类,得到所述抽象化语句的性能指标。
- 如权利要求6至9任一项所述的装置,其特征在于,所述处理单元还用于:在所述确定出所述数据库脚本的性能指标之后,根据所述数据库脚本的性能指标、所述数据库的特征、所述生产数据库的表信息、所述测试数据库的表信息和所述抽象化语句的执行频次,确定出所述数据库脚本的优化方案。
- 一种计算设备,其特征在于,包括:存储器,用于存储程序指令;处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1至5任一项所述的方法。
- 一种计算机可读非易失性存储介质,其特征在于,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行如权利要求1至5任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910562575.5 | 2019-06-26 | ||
| CN201910562575.5A CN110287114B (zh) | 2019-06-26 | 2019-06-26 | 一种数据库脚本性能测试的方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020259391A1 true WO2020259391A1 (zh) | 2020-12-30 |
Family
ID=68006171
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/096905 Ceased WO2020259391A1 (zh) | 2019-06-26 | 2020-06-18 | 一种数据库脚本性能测试的方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110287114B (zh) |
| WO (1) | WO2020259391A1 (zh) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110287114B (zh) * | 2019-06-26 | 2021-06-04 | 深圳前海微众银行股份有限公司 | 一种数据库脚本性能测试的方法及装置 |
| CN112035513A (zh) * | 2020-09-02 | 2020-12-04 | 中国平安人寿保险股份有限公司 | Sql语句性能优化方法、装置、终端及存储介质 |
| CN112181831B (zh) * | 2020-09-28 | 2024-09-27 | 中国平安财产保险股份有限公司 | 基于关键词的脚本性能校验方法、装置、设备及存储介质 |
| CN117290373B (zh) * | 2022-06-17 | 2025-10-31 | 腾讯科技(深圳)有限公司 | 一种语句分析方法及相关设备 |
| CN115687364B (zh) * | 2022-11-16 | 2025-09-19 | 深圳前海微众银行股份有限公司 | 一种确定数据库命令的预测资源消耗量方法及装置 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080250046A1 (en) * | 2005-03-15 | 2008-10-09 | International Business Machines Corporation | Analysis of performance data from a relational database system for applications using stored procedures or sql |
| CN102486748A (zh) * | 2010-12-02 | 2012-06-06 | 金蝶软件(中国)有限公司 | 一种性能测试的方法及装置 |
| CN105760286A (zh) * | 2016-02-17 | 2016-07-13 | 中国工商银行股份有限公司 | 应用数据库动态性能检测方法及检测装置 |
| CN107844425A (zh) * | 2017-11-16 | 2018-03-27 | 中国银行股份有限公司 | 一种数据库语句检查方法和装置 |
| CN110287114A (zh) * | 2019-06-26 | 2019-09-27 | 深圳前海微众银行股份有限公司 | 一种数据库脚本性能测试的方法及装置 |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7860899B2 (en) * | 2007-03-26 | 2010-12-28 | Oracle International Corporation | Automatically determining a database representation for an abstract datatype |
| US20100306591A1 (en) * | 2009-06-01 | 2010-12-02 | Murali Mallela Krishna | Method and system for performing testing on a database system |
| CN103399851B (zh) * | 2013-06-25 | 2017-02-08 | 上海携程商务有限公司 | 一种结构化查询语言(sql)脚本的性能分析与预测方法与系统 |
| CN103390066B (zh) * | 2013-08-08 | 2016-02-17 | 上海新炬网络信息技术有限公司 | 一种数据库全局性自动化优化预警装置及其处理方法 |
| CN103617273B (zh) * | 2013-12-05 | 2016-09-14 | 用友网络科技股份有限公司 | Sql脚本对象化的方法及系统 |
| CN103761080B (zh) * | 2013-12-25 | 2017-02-15 | 中国农业大学 | 一种基于SQL的MapReduce作业生成方法及系统 |
| CN108984374B (zh) * | 2017-06-01 | 2021-05-07 | 腾讯科技(深圳)有限公司 | 一种数据库性能的测试方法和系统 |
| CN108170775A (zh) * | 2017-12-26 | 2018-06-15 | 上海新炬网络技术有限公司 | 一种数据库sql索引动态优化方法 |
| CN108388626A (zh) * | 2018-02-12 | 2018-08-10 | 平安科技(深圳)有限公司 | Sql自动优化方法、装置、计算机设备及存储介质 |
-
2019
- 2019-06-26 CN CN201910562575.5A patent/CN110287114B/zh active Active
-
2020
- 2020-06-18 WO PCT/CN2020/096905 patent/WO2020259391A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080250046A1 (en) * | 2005-03-15 | 2008-10-09 | International Business Machines Corporation | Analysis of performance data from a relational database system for applications using stored procedures or sql |
| CN102486748A (zh) * | 2010-12-02 | 2012-06-06 | 金蝶软件(中国)有限公司 | 一种性能测试的方法及装置 |
| CN105760286A (zh) * | 2016-02-17 | 2016-07-13 | 中国工商银行股份有限公司 | 应用数据库动态性能检测方法及检测装置 |
| CN107844425A (zh) * | 2017-11-16 | 2018-03-27 | 中国银行股份有限公司 | 一种数据库语句检查方法和装置 |
| CN110287114A (zh) * | 2019-06-26 | 2019-09-27 | 深圳前海微众银行股份有限公司 | 一种数据库脚本性能测试的方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110287114B (zh) | 2021-06-04 |
| CN110287114A (zh) | 2019-09-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020259391A1 (zh) | 一种数据库脚本性能测试的方法及装置 | |
| CN107633265B (zh) | 用于优化信用评估模型的数据处理方法及装置 | |
| CN112508053A (zh) | 基于集成学习框架的智能诊断方法、装置、设备及介质 | |
| CN108470022B (zh) | 一种基于运维管理的智能工单质检方法 | |
| Zhang et al. | Fast fine-grained air quality index level prediction using random forest algorithm on cluster computing of spark | |
| CN110490229A (zh) | 一种基于spark和聚类算法的电能表检定误差诊断方法 | |
| WO2021128523A1 (zh) | 一种基于科技大数据的技术成熟度判断方法和系统 | |
| CN108229588A (zh) | 一种基于深度学习的机器学习识别方法 | |
| CN102541736A (zh) | 一种软件可靠性执行过程加速测试方法 | |
| CN109376247A (zh) | 一种基于关联规则的软件缺陷自动分类方法 | |
| CN115080386B (zh) | 基于自动驾驶功能要求的场景有效性分析方法与设备 | |
| WO2022143431A1 (zh) | 一种反洗钱模型的训练方法及装置 | |
| CN115456695A (zh) | 一种店铺选址的分析方法、装置、系统及介质 | |
| CN117421226A (zh) | 一种基于生成式大语言模型的缺陷报告重构的方法及系统 | |
| WO2023082788A1 (zh) | 烟气含氧量负荷预测方法、预测模型选择方法、烟气排放预测方法及装置 | |
| CN110310012B (zh) | 数据分析方法、装置、设备及计算机可读存储介质 | |
| CN112085335A (zh) | 一种用于配电网故障预测的改进随机森林算法 | |
| CN103207804B (zh) | 基于集群作业日志的MapReduce负载模拟方法 | |
| CN105631465A (zh) | 一种基于密度峰值的高效层次聚类方法 | |
| CN116823320A (zh) | 一种营商环境数据分析处理方法、系统、设备及存储介质 | |
| CN115526501A (zh) | 一种基于融合聚类的智能建筑节能评估方法 | |
| CN114331175A (zh) | 一种城市安全绩效数据集中统计评估方法及系统 | |
| CN120653523A (zh) | 一种基于机器学习的麒麟系统性能优化方法 | |
| CN107729942A (zh) | 一种结构化视图缺失数据的分类方法 | |
| CN112052284A (zh) | 一种大数据下的主数据管理方法及系统 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20830942 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20830942 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 060422) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20830942 Country of ref document: EP Kind code of ref document: A1 |


