Query statement processing method and device, computer equipment, readable storage medium and program product

By obtaining and parsing the process list of distributed database clusters, identifying and adjusting exception query statements, the problem of abnormal SQL statements affecting query efficiency is solved, and the effect of reducing query time and cluster resource waste is achieved.

CN119106068APending Publication Date: 2024-12-10SUZHOU LANGDONG NET TEC CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411298997.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Exceptional SQL statements will affect query efficiency, resulting in extended response time or query failure, affecting system stability. A method that can detect and adjust exception query statements is needed to reduce query time and waste of cluster resources.

Method used

By obtaining the process list of distributed database clusters, extracting and parsing query statements, determining the fields and field query paths to be filtered, matching the index information in the system table, identifying the indexed query statement without indexes, and exceeding the memory usage or field length. The threshold is determined as the statement to be adjusted, and is pushed to the message middleware for alarm and storage, real-time monitoring and adjustment.

Benefits of technology

Effectively identify and adjust exception query statements to reduce query time, avoid resource waste, and improve system stability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106068A_ABST
    Figure CN119106068A_ABST
Patent Text Reader

Abstract

The invention relates to a query statement processing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a process list of a distributed database cluster; the process list is used for processing request processing information when the distributed database cluster processes the request; extracting a query statement from the process list, and analyzing the query statement to obtain a to-be-screened field and a field query path of the to-be-screened field; and based on the field query path of the to-be-screened field, performing matching query on the to-be-screened field in a system table of the distributed database cluster, and under the condition that the index information of the to-be-screened field does not exist in the system table, determining that the query statement is a to-be-adjusted statement. By adopting the method, query time consumption and cluster resource waste can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a query statement processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] Tidb cluster is a distributed database management system with powerful data storage and processing capabilities, and as a result, it is gaining increasing popularity. Tidb (TiKV Distributed Database) clusters support data queries and operations using Structured Query Language (SQL) statements.

[0003] However, in real-world applications, abnormal SQL statements (e.g., poorly written SQL statements) may exist. Abnormal SQL statements can affect query efficiency, extend response time, or even cause query failures, further impacting system stability. Therefore, a query statement processing method that can detect abnormal SQL statements is urgently needed. Summary of the Invention

[0004] Based on this, it is necessary to provide a query statement processing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can reduce query time and cluster resource waste in order to address the above technical problems.

[0005] In a first aspect, the present application provides a method for processing a query statement, comprising:

[0006] Obtaining a process list of a distributed database cluster; the process list is used to process request processing information when the distributed database cluster processes a request;

[0007] Extracting a query statement from the process list, and parsing the query statement to obtain a field to be filtered and a field query path of the field to be filtered;

[0008] Based on the field query path of the field to be filtered, a matching query is performed on the field to be filtered in the system table of the distributed database cluster. If index information of the field to be filtered does not exist in the system table, the query statement is determined to be a statement to be adjusted.

[0009] In one embodiment, after extracting the query statement from the process list and parsing the query statement to obtain the field to be filtered and the field query path of the field to be filtered, the following steps are further included:

[0010] extracting a value of a memory usage field corresponding to the query statement from the process list, and determining that the query statement is a statement to be adjusted if the value of the memory usage field is greater than a preset first threshold;

[0011] Alternatively, the field length of the query statement is calculated, and when the field length is greater than a preset second threshold, the query statement is determined to be a statement to be adjusted.

[0012] In one embodiment, obtaining a process list of a distributed database cluster includes:

[0013] Regularly obtain the process list of the distributed database cluster and push it to the message middleware;

[0014] A list of processes consuming the message middleware.

[0015] In one embodiment, the method further comprises:

[0016] In response to determining that the query statement is a statement to be adjusted, pushing the query statement to a message middleware;

[0017] The query statement in the message middleware is consumed, and an alarm is generated based on the query statement.

[0018] In one embodiment, the issuing of an alert based on the query statement includes:

[0019] Obtaining object identification information associated with the query statement; the object identification information is obtained by extracting the object identification information from the query statement, or obtaining the object identification information corresponding to the field query path;

[0020] Based on the object identification information, the alarm information including the query statement is pushed to the corresponding business object terminal.

[0021] In one embodiment, in response to determining that the query statement is a statement to be adjusted, the query statement is pushed to the message middleware, and then the method includes:

[0022] The query statements in the message middleware are consumed and stored in the index of the distributed search engine; the distributed search engine is used to update the query statements in the index according to a preset data life cycle.

[0023] In a second aspect, the present application further provides a query statement processing device, comprising:

[0024] An acquisition module, configured to acquire a process list of a distributed database cluster; the process list is used to process request processing information when the distributed database cluster processes a request;

[0025] A parsing module, configured to extract a query statement from the process list and parse the query statement to obtain a field to be filtered and a field query path of the field to be filtered;

[0026] A determination module is used to perform a matching query on the field to be filtered in the system table of the distributed database cluster based on the field query path of the field to be filtered, and determine that the query statement is a statement to be adjusted if there is no index information of the field to be filtered in the system table.

[0027] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.

[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the above-described methods when the computer program is executed by a processor.

[0029] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the steps of any of the above methods when executed by a processor.

[0030] The query statement processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product described above can achieve real-time monitoring of currently active database connections and queries executed by them by obtaining a process list. By extracting and parsing query statements in the process list, the fields to be queried can be determined. Furthermore, by querying system tables, the index usage of these fields can be determined, and abnormal query statements without indexes can be identified, thereby facilitating adjustment of abnormal query statements and reducing query time and cluster resource waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0032] FIG1 is a diagram illustrating an application environment of a method for processing query statements in one embodiment;

[0033] FIG2 is a flow chart of a method for processing a query statement in one embodiment;

[0034] FIG3 is a flow chart of a method for processing a query statement in another embodiment;

[0035] FIG4 is a schematic diagram of the process of step S202 in one embodiment;

[0036] FIG5 is a flow chart of a method for processing a query statement in yet another embodiment;

[0037] FIG6 is a flow chart showing steps for generating an alarm based on a query statement in one embodiment;

[0038] FIG7 is a flow chart of a method for processing a query statement in yet another embodiment;

[0039] FIG8 is a block diagram of a query statement processing apparatus according to an embodiment;

[0040] FIG9 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0042] The query statement processing method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. In this case, the terminal 102 communicates with the server 104 via a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. In this case, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0043] In an exemplary embodiment, as shown in FIG2 , a method for processing a query statement is provided, which is described by taking the method applied to the server 104 in FIG1 as an example, and includes the following steps S202 to S206 .

[0044] Step S202: Obtain a process list of the distributed database cluster; the process list is used to process request processing information when the distributed database cluster processes a request.

[0045] A distributed database cluster can be a system consisting of multiple database nodes connected via a network to jointly process data storage and query requests. A process list can be a collection of information about currently active connections in the distributed database cluster, including each connection's status, executed queries, and user information. The process list can be used to store or retrieve request processing information while the distributed database cluster is processing requests.

[0046] For example, for a Tidb cluster, the request processing information in the process list (PROCESSLIST) includes but is not limited to: connection ID (Identity document), user, database, query status, executed request statement, start time, running time, etc.

[0047] Step S204: extracting a query statement from the process list, and parsing the query statement to obtain a field to be filtered and a field query path of the field to be filtered.

[0048] Exemplarily, each connection in the process list can be traversed to obtain the corresponding query statement. In one possible implementation, the query statement can be extracted from the process list based on the field name (for example, for a Tidb cluster, the query statement is the INFO field). The query statement may include a field query path, fields to be filtered, and their filtering conditions. In one possible implementation, the field query path can be obtained by parsing the FROM clause of the query statement. The field query path may include a table name. The field query path may also include a database name, and the database name may be extracted from the process list based on the field name. The fields to be filtered can be obtained by parsing the WHERE clause of the query statement. For example, the fields to be filtered may be fields such as Status and UpdatedTime.

[0049] Step S206 : Based on the field query path of the field to be filtered, a matching query is performed on the field to be filtered in the system table of the distributed database cluster. If there is no index information of the field to be filtered in the system table, the query statement is determined to be a statement to be adjusted.

[0050] The system table of the distributed database cluster can be used to store metadata of the distributed database cluster, including table structure, index information, etc. In one possible implementation, the system table of the distributed database cluster can be obtained regularly, and statements to be adjusted can be detected and located based on the system table.

[0051] For example, for a Tidb cluster, a matching query can be performed on the to-be-filtered fields in the TIDB_INDEXES table based on the field query path of the to-be-filtered fields. If index information for the to-be-filtered fields does not exist in the system table, the query needs to scan the entire table, resulting in a decrease in query performance. Therefore, this query statement can be adjusted.

[0052] Optionally, when the query statement is parsed and it is determined that the query statement does not include a WHERE clause, the query statement may also be determined to be a statement to be adjusted. For example, executing a delete SQL statement that does not include a WHERE clause may result in data loss.

[0053] In the above query statement processing method, by obtaining the process list, real-time monitoring of the currently active database connection and the queries executed by it can be achieved. By extracting and parsing the query statements in the process list, the fields that need to be queried can be determined. Then, by querying the system table, the index usage of these fields can be determined, and abnormal query statements without indexes can be identified, which facilitates the adjustment of abnormal query statements and reduces query time and cluster resource waste.

[0054] In an exemplary embodiment, as shown in FIG3 , the method for processing the query statement may further include:

[0055] Step S208 : extracting the value of the memory usage field corresponding to the query statement from the process list, and determining that the query statement is a statement to be adjusted when the value of the memory usage field is greater than a preset first threshold.

[0056] For example, for a Tidb cluster, the value of the MEM field can be extracted from the process list to obtain the memory usage of the query statement. If the value of the memory usage field is greater than a preset first threshold, the memory usage of the query statement is too large, so the query statement can be adjusted.

[0057] Step S210 , calculating the field length of the query statement, and determining that the query statement is a statement to be adjusted when the field length is greater than a preset second threshold.

[0058] For example, for a Tidb cluster, the length of the INFO field can be calculated based on the LENGTH function to obtain the field length of the query statement. If the field length is greater than a preset second threshold, the length of the query statement is too long. Therefore, the query statement can be adjusted.

[0059] In this embodiment, by monitoring the memory usage of query statements, queries that occupy too much memory can be discovered in a timely manner, avoiding performance degradation caused by insufficient memory; by calculating the field length of query statements, overly long queries can be identified, query complexity can be reduced, and execution efficiency can be improved.

[0060] In an exemplary embodiment, as shown in FIG4 , step S202 may include:

[0061] Step S2021: regularly obtain the process list of the distributed database cluster and push it to the message middleware.

[0062] Step S2022: consume the process list in the message middleware.

[0063] For example, a scheduled task can be set up to execute at regular intervals, obtain the list of currently active processes, and push it to a message-based middleware (e.g., Kafka). After consuming the data in the message-based middleware, the consumed process list is parsed to detect abnormal query statements that need adjustment.

[0064] In this embodiment, by storing the process list of the distributed database cluster in the message middleware and then consuming it, the collection and processing of the process list are decoupled, and the flexibility and reliability of detecting abnormal query statements are improved.

[0065] In an exemplary embodiment, as shown in FIG5 , the method for processing the query statement may further include:

[0066] Step S212: In response to determining that the query statement is a statement to be adjusted, the query statement is pushed to the message middleware.

[0067] Optionally, in response to determining that the query statement is a statement to be adjusted, a Kill function may be executed for the statement to be adjusted.

[0068] Step S214: consume the query statement in the message middleware and generate an alarm based on the query statement.

[0069] For example, abnormal query statements that need to be adjusted and their related information can be pushed to a message middleware (e.g., Kafka) in real time. Then, after consuming the data in the message middleware, real-time warnings are issued based on the consumed query statements and their related information.

[0070] In this embodiment, by storing the abnormal query statements that need to be adjusted in the message middleware and then consuming them, the detection of abnormal query statements and the alarm are decoupled, thereby ensuring the reliability of the alarm.

[0071] Furthermore, as shown in FIG6 , the above-mentioned step of generating an alarm based on a query statement may include:

[0072] Step A1, obtaining object identification information associated with the query statement; the object identification information is obtained by extracting the object identification information from the query statement, or obtaining the object identification information corresponding to the field query path.

[0073] Exemplarily, the object identification information associated with the query statement may be predetermined, extracted in real time from the annotations of the query statement, or found in the library or table metadata based on the library name or table name in the field query path.

[0074] Step A2: Pushing alarm information including query statements to the corresponding business object terminal based on the object identification information.

[0075] In one possible implementation, the alarm information may include but is not limited to: risk level (for example, low, medium, high), exception type (for example, SQL lacks an index, SQL memory usage exceeds 5GB, SQL length exceeds 5MB, etc.), detection time, source address, user account, the first 1200 characters of the query statement, database name, table English name, table Chinese comment, development person in charge, estimated number of table rows, estimated table size, query statement length, memory usage, etc.

[0076] In this embodiment, by sending the warning information and related information to the relevant personnel, the relevant personnel can timely understand the operation status of the query statements they are responsible for.

[0077] In an exemplary embodiment, as shown in FIG7 , the method for processing the query statement may further include:

[0078] Step S216: consume the query statement in the message middleware and store the query statement in the index of the distributed search engine; the distributed search engine is used to update the query statement in the index according to the preset data life cycle.

[0079] For example, data from the message middleware can be stored in real time in a distributed search engine index using the pyflink program, which is Apache Flink's Python Application Programming Interface (API). The distributed search engine can be Elasticsearch (ES), an open-source, highly scalable distributed full-text search engine. Furthermore, ES can be used to set a lifespan for the data in the index (for example, 7 days). The index can be regularly checked for unusual query statements that require adjustment to determine if they have expired. If so, the corresponding query statement and related information can be updated or deleted.

[0080] Furthermore, you can use Kibana to view and display abnormal query statements and related information that need to be adjusted in es. Kibana provides data visualization capabilities, and relevant personnel can create dashboards to monitor the status of abnormal query statements that need to be adjusted in real time.

[0081] In this embodiment, by consuming abnormal query statements in the message middleware and storing them in the distributed search engine, relevant personnel can easily view and adjust these abnormal query statements in real time. At the same time, by setting up the distributed search engine to automatically manage the query statement lifecycle, relevant personnel can more conveniently perform historical queries.

[0082] To sum up, in the above query statement processing method, by obtaining the process list, real-time monitoring of the currently active database connection and the queries executed by it can be achieved. By extracting and parsing the query statements in the process list, the fields that need to be queried can be determined. Then, by querying the system table, the index usage of these fields can be determined, and abnormal query statements without indexes can be identified, which facilitates the adjustment of abnormal query statements and reduces query time and cluster resource waste.

[0083] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0084] Based on the same inventive concept, embodiments of the present application also provide a query statement processing device for implementing the query statement processing method described above. The solution provided by this device is similar to the solution described in the method described above. Therefore, the specific limitations of the one or more query statement processing device embodiments provided below can be found in the limitations of the query statement processing method described above and will not be repeated here.

[0085] In an exemplary embodiment, as shown in FIG8 , a query statement processing apparatus 300 is provided, comprising: an acquisition module 301 , a parsing module 302 , and a determination module 303 , wherein:

[0086] The acquisition module 301 is used to acquire a process list of the distributed database cluster; the process list is used to process request processing information when the distributed database cluster processes a request.

[0087] The parsing module 302 is used to extract a query statement from the process list and parse the query statement to obtain the field to be filtered and the field query path of the field to be filtered.

[0088] The determination module 303 is configured to perform a matching query on the field to be filtered in the system table of the distributed database cluster based on the field query path of the field to be filtered, and determine that the query statement is a statement to be adjusted if index information of the field to be filtered does not exist in the system table.

[0089] In an exemplary embodiment, the determining module 303 is further configured to:

[0090] Extracting a value of a memory usage field corresponding to the query statement from the process list, and determining that the query statement is a statement to be adjusted if the value of the memory usage field is greater than a preset first threshold;

[0091] Alternatively, the field length of the query statement is calculated, and when the field length is greater than a preset second threshold, the query statement is determined to be a statement to be adjusted.

[0092] In an exemplary embodiment, the acquisition module 301 is further configured to:

[0093] Regularly obtain the process list of the distributed database cluster and push it to the message middleware;

[0094] A list of processes in the consumer message middleware.

[0095] In an exemplary embodiment, the query statement processing device 300 further includes an alarm module, wherein the alarm module is configured to:

[0096] In response to determining that the query statement is a statement to be adjusted, pushing the query statement to the message middleware;

[0097] Consume query statements in the message middleware and generate alerts based on the query statements.

[0098] In an exemplary embodiment, the alarm module is further configured to:

[0099] Obtaining object identification information associated with the query statement; the object identification information is obtained by extracting the object identification information from the query statement, or obtaining the object identification information corresponding to the field query path;

[0100] Based on the object identification information, the alarm information including the query statement is pushed to the corresponding business object terminal.

[0101] In an exemplary embodiment, the query statement processing device 300 further includes:

[0102] The storage module is used to consume query statements in the message middleware and store the query statements in the index of the distributed search engine; the distributed search engine is used to update the query statements in the index according to the preset data life cycle.

[0103] Each module in the query processing device described above may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in hardware form, or may be stored in a memory in a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0104] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in Figure 9. The computer device includes a processor, memory, an input / output (I / O) interface, and a communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The I / O interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a method for processing query statements.

[0105] Those skilled in the art will understand that the structure shown in Figure 9 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0106] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0107] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0108] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0109] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0110] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0111] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0112] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for processing a query statement, characterized in that: The method comprises: Obtaining a process list of a distributed database cluster; the process list is used to process request processing information when the distributed database cluster processes a request; Extracting a query statement from the process list, and parsing the query statement to obtain a field to be filtered and a field query path of the field to be filtered; Based on the field query path of the field to be filtered, a matching query is performed on the field to be filtered in the system table of the distributed database cluster, and when index information of the field to be filtered does not exist in the system table, it is determined that the query statement is a statement to be adjusted.

2. The method according to claim 1, characterized in that: After extracting the query statement from the process list and parsing the query statement to obtain the field to be filtered and the field query path of the field to be filtered, the following steps are included: Extracting the value of the memory usage field corresponding to the query statement from the process list, and determining that the query statement is a statement to be adjusted when the value of the memory usage field is greater than a preset first threshold; Alternatively, the field length of the query statement is calculated, and when the field length is greater than a preset second threshold, the query statement is determined to be a statement to be adjusted.

3. The method according to claim 1, characterized in that The process of obtaining the distributed database cluster includes: Regularly obtain the process list of the distributed database cluster and push it to the message middleware; A list of processes that consume the message middleware.

4. The method according to claim 1, characterized in that: The method further comprises: In response to determining that the query statement is a statement to be adjusted, pushing the query statement to a message middleware; The query statements in the message middleware are consumed, and an alarm is issued based on the query statements.

5. The method according to claim 4, characterized in that The issuing of an alarm based on the query statement includes: Obtaining object identification information associated with the query statement; the object identification information is obtained by: extracting the object identification information from the query statement, or obtaining the object identification information corresponding to the field query path; Based on the object identification information, the warning information including the query statement is pushed to the corresponding business object terminal.

6. The method according to claim 4, characterized in that In response to determining that the query statement is a statement to be adjusted, the query statement is pushed to the message middleware, and then the method includes: The query statements in the message middleware are consumed, and the query statements are stored in the index of the distributed search engine; the distributed search engine is used to update the query statements in the index according to a preset data life cycle.

7. A query statement processing device, characterized in that: The device comprises: An acquisition module, used to acquire a process list of a distributed database cluster; the process list is used to process request processing information when the distributed database cluster processes a request; A parsing module, used to extract a query statement from the process list, and parse the query statement to obtain a field to be filtered and a field query path of the field to be filtered; A determination module is used to perform a matching query on the field to be filtered in the system table of the distributed database cluster based on the field query path of the field to be filtered, and determine that the query statement is a statement to be adjusted if there is no index information of the field to be filtered in the system table.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • List sorting method and device and computer equipment

    CN119415525A

  • A method, device and computer equipment for sorting a list

    CN119415525B