Database code inspection device and method

A technology of an inspection device and an inspection method, applied in the field of network databases, can solve problems such as database bottlenecks, reduce database query efficiency, system application crashes, etc., and achieve the effects of reducing misjudgments and reducing failure risks.

Inactive Publication Date: 2017-06-13
NUBIA TECHNOLOGY CO LTD
View PDF5 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The database index is like the table of contents in front of a book. If the index is properly set, the query speed of the database can be accelerated; if the index is not set or the index setting is unreasonable, the query efficiency of the database will be reduced. Moreover, when the data access volume of the database reaches When hundreds of thousands or even more, there will be a bottleneck problem in the database, which may cause the exhaustion of database resources and cause the system application to crash

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Database code inspection device and method
  • Database code inspection device and method
  • Database code inspection device and method

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0056] Such as Figure 4 Shown, according to the first embodiment of the checking method of database code of the present invention, comprise the following steps:

[0057] Open the log of the database, pull the log file of the database and copy it to the backup file;

[0058] Index analysis is performed on the statements in the backup file, and the data tables with no index or unreasonable index settings in the database are obtained.

[0059] Optionally, the log of the opened database is a query log. Query log, used to record established client connections and executed statements. In the MySQL database, use the --log[=log file name] or -l[log file name] command to start querying the log. If there is no value for the log file name, the default log file name is host_name.log. After the query log is enabled for the MySQL database, users can view the SQL statements executed in the MySQL database in the log file.

[0060] Optionally, the log file of the database is pulled by exe...

no. 2 example

[0063] Such as Figure 5 Shown, according to the second embodiment of the checking method of database code of the present invention, comprise the following steps:

[0064] Open the log of the database, pull the log file of the database and copy it to the backup file;

[0065] Use preset rules to filter the statements in the backup file;

[0066] Index analysis is performed on the filtered statements in the backup file, and the data tables with no index or unreasonable index settings in the database are obtained.

[0067] Optionally, the pre-set rules include at least one of data tables that do not need to be checked, a check threshold of table data volume, a calling frequency threshold, or statements that do not need to be checked. For example, if you set the data table that does not need to be checked as a, delete all SQL statements that only call data table a from the backup file; Delete the SQL statement of the data table with less than 10,000 entries from the backup fil...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a database code inspection device and method. The device comprises a logging module, used for opening a database log, dragging a log file of the database and copying to a backup file; and an analysis module, used for indexing and analyzing the statements in the back up file, and a data table not set with an index in the database or index settings being unreasonable is obtained. Optionally, the device comprises further a filtering module, used for using pre-set rules and filtering the statements in the back up file. Optionally, the device comprises further a statistics module, used for data tables not set with an index or indexing settings being unreasonable, and statistic measurements are conducted in accordance with preset properties. According to the database code inspection device and method, through the indexing and analyses of SQL statements in the database log, the case of whether or not the database of the development code being provided with reasonable table indexes is checked; the inspection range is controlled flexibly through pre-defined rules; and if needed, the project developers are warned in advance, to reduce the risk of fault.

Description

technical field [0001] The invention relates to the technical field of network databases, in particular to a database code checking device and method. Background technique [0002] Structured Query Language (Structured Query Language, SQL) is a database query and programming language for accessing data and querying, updating and managing relational database systems. Existing relational databases include Oracle, DB2, SQL Server , Sybase, MySQL, etc. [0003] With the increasing application of relational databases, more and more data needs to be stored and accessed. The database index is like the table of contents in front of a book. If the index is properly set, the query speed of the database can be accelerated; if the index is not set or the index setting is unreasonable, the query efficiency of the database will be reduced. Moreover, when the data access volume of the database reaches When hundreds of thousands or even more, there will be a bottleneck problem of the data...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30G06F11/36
Inventor 程文星
Owner NUBIA TECHNOLOGY CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products