CN117807132A - Distributed database histogram creation method, device, equipment and storage medium - Google Patents

Distributed database histogram creation method, device, equipment and storage medium Download PDF

Info

Publication number
CN117807132A
CN117807132A CN202311847863.8A CN202311847863A CN117807132A CN 117807132 A CN117807132 A CN 117807132A CN 202311847863 A CN202311847863 A CN 202311847863A CN 117807132 A CN117807132 A CN 117807132A
Authority
CN
China
Prior art keywords
histogram
information
database
distributed database
line number
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.)
Pending
Application number
CN202311847863.8A
Other languages
Chinese (zh)
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.)
Jinzhuan Xinke Co Ltd
Original Assignee
Jinzhuan Xinke 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 Jinzhuan Xinke Co Ltd filed Critical Jinzhuan Xinke Co Ltd
Priority to CN202311847863.8A priority Critical patent/CN117807132A/en
Publication of CN117807132A publication Critical patent/CN117807132A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The utility model discloses a method, a device and a storage medium for creating a distributed database histogram, which are characterized in that a database row list and a histogram information list are created in the distributed database, analysis instruction inquiry is executed and table information, row number information and histogram information on each piece in the distributed database are counted, so that the database row list and the histogram information list are updated, the database row list and the histogram information list are loaded on a CN layer, and the histogram is created and displayed through total weight evaluation, so that the technical problem that the current database histogram creation cannot meet the actual demand due to the position distribution mode reasons of each table in the distributed database is solved, SQL statement execution logic is different from that of the traditional database, and the histogram logic is changed.

Description

Distributed database histogram creation method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a method, an apparatus, a device, and a storage medium for creating a distributed database histogram.
Background
A histogram (histogram) is an important statistical information in the database, which can describe the data distribution in the column, and can well guide the optimizer to select the execution path. The data distribution of the specified column is stored using the histogram. The most typical application scenario for a histogram is to help the optimizer select the optimal execution plan by estimating the selectivity of the query predicates.
In the case where there is no index on one column and no histogram, the database defaults to uniformly distributing the data throughout the table and then retrieves the where condition, so that the execution plan is highly likely inaccurate, his estimation is very rough, ignoring the data distribution, and the histogram can reflect the data distribution more accurately, the accuracy of the histogram can be determined by the user, and help in the database in generating the query plan. The filter value of the column in the query plan, without an index, reads the corresponding information from the histogram, thereby more accurately estimating the number of rows needed.
The distributed database divides a single table with large data volume into a plurality of tables with small data volume to be distributed on a plurality of data nodes, and simultaneously a CN layer (ComputerNode) is introduced to be responsible for processing the distribution rules and the complex SQL sentences. Because of the position distribution mode of each table, SQL sentence execution logic is different from that of the traditional database, and histogram logic is also changed, so that in order to meet the actual requirement, a histogram construction method supporting a distributed database is needed.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for creating a histogram of a distributed database, which solve the technical problems that SQL statement execution logic is different from that of a traditional database and histogram logic is changed because of the position distribution mode of each table in the distributed database, and the current database histogram creation cannot meet actual demands.
In view of this, a first aspect of the present application provides a distributed database histogram creation method, the method comprising:
s1, creating a database row list in a distributed database, wherein the database row list is used for recording list rows;
s2, creating a histogram information table in the distributed database, wherein the histogram information table is used for recording the detailed information of each field histogram of the table;
s3, executing analysis instructions to update table information, line number information and histogram information on each fragment in the distributed database to the database line number table and the histogram information table;
s4, when the CN layer has a requirement for creating the histogram, the database line table and the data information in the histogram information table are called to create the histogram.
Optionally, the step S3 specifically includes:
and executing a first analysis instruction, so that table information, line number information and histogram information of different tables of different target databases in the distributed database are updated into the database line number table and the histogram information table.
Optionally, the step S3 specifically includes:
and executing a second analysis instruction, so that the table information, the line number information and the histogram information of all the tables of one target database in the distributed database are updated into the database line number table and the histogram information table.
Optionally, the method further comprises:
creating a timing update task so that the analysis instructions are executed at preset time intervals or target time points.
Optionally, the method further comprises:
executing the step S3 when one CN node in the CN layer initiates an analysis instruction;
and the CN node sends a message to a management node, and the management node broadcasts the message to other CN nodes in the CN layer, so that the other CN nodes update the local cache according to the database row list and the histogram information list.
A second aspect of the present application provides a distributed database histogram creation apparatus, the apparatus comprising:
the first creating unit is used for creating a database row list in the distributed database, wherein the database row list is used for recording the number of the table rows;
a second creating unit configured to create a histogram information table in the distributed database, the histogram information table being used to record the individual field histogram detailed information of the table;
the execution unit is used for executing analysis instructions to update the table information, the line number information and the histogram information on each fragment in the distributed database to the database line number table and the histogram information table;
and the histogram creation unit is used for calling the database line table and the data information in the histogram information table to create a histogram when the histogram creation requirement exists in the CN layer.
Optionally, the execution unit is specifically configured to:
and executing a first analysis instruction, so that table information, line number information and histogram information of different tables of different target databases in the distributed database are updated into the database line number table and the histogram information table.
Optionally, the execution unit is specifically configured to:
and executing a second analysis instruction, so that the table information, the line number information and the histogram information of all the tables of one target database in the distributed database are updated into the database line number table and the histogram information table.
A third aspect of the present application provides a distributed database histogram creation apparatus, the apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the steps of the method of distributed database histogram creation as described in the first aspect above according to instructions in the program code.
A fourth aspect of the present application provides a computer readable storage medium for storing program code for performing the method of the first aspect described above.
From the above technical solutions, the embodiments of the present application have the following advantages:
in the application, a method, a device, equipment and a storage medium for creating a distributed database histogram are provided, by creating a database row list and a histogram information list in the distributed database, executing analysis instruction query and counting table information, row number information and histogram information on each piece in the distributed database, thereby updating the database row list and the histogram information list, loading the database row list and the histogram information list on a CN layer, and creating and displaying the histogram by collecting weight evaluation, so that the technical problem that the current database histogram creation cannot meet actual requirements due to the position distribution mode reasons of each table in the distributed database is solved, SQL sentence execution logic is different from that of the traditional database, and the histogram logic is changed.
Drawings
FIG. 1 is a method flow chart of a distributed database histogram creation method in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a distributed database histogram creation apparatus in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a distributed database histogram creation apparatus in an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The application designs a method, a device, equipment and a storage medium for creating a histogram of a distributed database, which solve the technical problems that SQL statement execution logic is different from that of a traditional database and histogram logic is changed because of the position distribution mode of each table in the distributed database, and the current database histogram creation cannot meet actual demands.
For ease of understanding, referring to fig. 1, fig. 1 is a flowchart of a method for creating a histogram of a distributed database according to an embodiment of the present application, as shown in fig. 1, specifically:
s1, creating a database row list in a distributed database, wherein the database row list is used for recording the row number of the list;
it should be noted that, a database row table gdb_table_rows_info is created in the distributed database, and the database row table is used for recording the table rows.
S2, creating a histogram information table in the distributed database, wherein the histogram information table is used for recording the detailed information of each field histogram of the table;
it should be noted that, a histogram information table gdb_table_bundles_info is created in the distributed database, and the histogram information table is used to record the detailed information of the histograms of the various fields of the table.
S3, executing analysis instructions to update the table information, the line number information and the histogram information on each fragment in the distributed database to a database line number table and a histogram information table;
it should be noted that, the client executes the analysis instruction, and the table information, the line number information and the histogram information on each slice in the distributed database are updated into the database line number table and the histogram information table.
S4, when the CN layer has a requirement for creating the histogram, the database line table and the data information in the histogram information table are called to create the histogram.
It should be noted that, the CN layer may create and display a histogram as required, by the following commands:
analyze table tab_name update histogram on field_name with num(0~1024)buckets;
histogram presentation for all fields of a table:
showhistogram ontab _name; viewing graphical histograms from/to management page
Histogram presentation for a single field of a table:
showhistogram ontab _name field_name; viewing graphical histograms from/to management page
Further, the step S3 specifically includes:
and executing a first analysis instruction to update the table information, the line number information and the histogram information of different tables of different target databases in the distributed database into the database line number table and the histogram information table.
It should be noted that, the first analysis instruction may be:
analyze tabledb1.tab1, db2.tab2 forhistory; different tables for different databases
And updating the table information, the line number information and the histogram information of different tables of different target databases into the database line number table and the histogram information table.
Further, the step S3 specifically includes:
and executing a second analysis instruction to update the table information, the line number information and the histogram information of all the tables of one target database in the distributed database to the database line number table and the histogram information table.
It should be noted that, the second analysis instruction may be:
analyze database db1 for history; for a single database, default all tables when no tables are specified
And updating the table information, the line number information and the histogram information of all the tables of one target database into the database line number table and the histogram information table.
Further, the method further comprises the following steps:
a timed update task is created such that the analysis instructions are executed at preset time intervals or target points in time.
It should be noted that a timed update task is created, and the effect of the task is consistent with the effect of executing the analysis instruction.
Further, the method further comprises the following steps:
when one CN node in the CN layer initiates an analysis instruction, executing step S3;
and the CN node sends a message to the management node, and the management node broadcasts the message to other CN nodes in the CN layer, so that the other CN nodes update the local cache according to the database row table and the histogram information table.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a distributed database histogram creation apparatus according to an embodiment of the present application, and as shown in fig. 2, the structure is specifically as follows:
a first creating unit 201, configured to create a database row table in the distributed database, where the database row table is used to record the row number of the table;
it should be noted that, a database row table gdb_table_rows_info is created in the distributed database, and the database row table is used for recording the table rows.
A second creating unit 202 for creating a histogram information table in the distributed database, the histogram information table being used for recording the individual field histogram detailed information of the table;
it should be noted that, a histogram information table gdb_table_bundles_info is created in the distributed database, and the histogram information table is used to record the detailed information of the histograms of the various fields of the table.
An execution unit 203, configured to execute an analysis instruction, so that table information, line number information and histogram information on each slice in the distributed database are updated into a database line number table and a histogram information table;
it should be noted that, the client executes the analysis instruction, and the table information, the line number information and the histogram information on each slice in the distributed database are updated into the database line number table and the histogram information table.
And a histogram creation unit 204, configured to call the data information in the database row table and the histogram information table to create a histogram when the CN layer has a histogram creation requirement.
It should be noted that, the CN layer may create and display a histogram as required, by the following commands:
analyze table tab_name update histogram on field_name with num(0~1024)buckets;
histogram presentation for all fields of a table:
showhistogram ontab _name; viewing graphical histograms from/to management page
Histogram presentation for a single field of a table:
showhistogram ontab _name field_name; viewing graphical histograms from/to management page
Further, the execution unit is specifically configured to:
and executing a first analysis instruction to update the table information, the line number information and the histogram information of different tables of different target databases in the distributed database into the database line number table and the histogram information table.
It should be noted that, the first analysis instruction may be:
analyze tabledb1.tab1, db2.tab2 forhistory; different tables for different databases
And updating the table information, the line number information and the histogram information of different tables of different target databases into the database line number table and the histogram information table.
Further, the execution unit is specifically configured to:
and executing a second analysis instruction to update the table information, the line number information and the histogram information of all the tables of one target database in the distributed database to the database line number table and the histogram information table.
It should be noted that, the second analysis instruction may be:
analyze database db1 for history; for a single database, default all tables when no tables are specified
And updating the table information, the line number information and the histogram information of all the tables of one target database into the database line number table and the histogram information table.
The embodiment of the present application further provides another apparatus for creating a histogram of a distributed database, as shown in fig. 3, for convenience of explanation, only a portion related to the embodiment of the present application is shown, and specific technical details are not disclosed, please refer to a method portion of the embodiment of the present application. The terminal can be any terminal equipment including a mobile phone, a tablet personal computer, a personal digital assistant (English full name: personal DigitalAssistant, english abbreviation: PDA), a sales terminal (English full name: point of sales, english abbreviation: POS), a vehicle-mounted computer and the like, taking the mobile phone as an example of the terminal:
fig. 3 is a block diagram showing a part of a structure of a mobile phone related to a terminal provided in an embodiment of the present application. Referring to fig. 3, the mobile phone includes: radio Frequency (RF) circuit 1010, memory 1020, input unit 1030, display unit 1040, sensor 1050, audio circuit 1060, wireless fidelity (wireless fidelity, wiFi) module 1070, processor 1080, and power source 1090. Those skilled in the art will appreciate that the handset configuration shown in fig. 3 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 3:
the RF circuit 1010 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the signal is processed by the processor 1080; in addition, the data of the design uplink is sent to the base station. Generally, RF circuitry 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (English full name: lowNoiseAmplifier, english abbreviation: LNA), a duplexer, and the like. In addition, the RF circuitry 1010 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to global system for mobile communications (english: global System ofMobile communication, english: GSM), general packet radio service (english: general Packet Radio Service, GPRS), code division multiple access (english: code Division Multiple Access, english: CDMA), wideband code division multiple access (english: wideband Code DivisionMultipleAccess, english: WCDMA), long term evolution (english: long TermEvolution, english: LTE), email, short message service (english: shortMessaging Service, SMS), and the like.
The memory 1020 may be used to store software programs and modules that the processor 1080 performs various functional applications and data processing of the handset by executing the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 1020 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state memory device.
The input unit 1030 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1031 or thereabout using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch panel 1031 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 1080 and can receive commands from the processor 1080 and execute them. Further, the touch panel 1031 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1030 may include other input devices 1032 in addition to the touch panel 1031. In particular, other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a track ball, a mouse, a joystick, etc.
The display unit 1040 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 1040 may include a display panel 1041, and alternatively, the display panel 1041 may be configured in the form of a liquid crystal display (english full name: liquid Crystal Display, acronym: LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 1031 may overlay the display panel 1041, and when the touch panel 1031 detects a touch operation thereon or thereabout, the touch panel is transferred to the processor 1080 to determine a type of touch event, and then the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of touch event. Although in fig. 3, the touch panel 1031 and the display panel 1041 are two independent components for implementing the input and output functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1041 and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the handset are not described in detail herein.
Audio circuitry 1060, a speaker 1061, and a microphone 1062 may provide an audio interface between a user and a cell phone. Audio circuit 1060 may transmit the received electrical signal after audio data conversion to speaker 1061 for conversion by speaker 1061 into an audio signal output; on the other hand, microphone 1062 converts the collected sound signals into electrical signals, which are received by audio circuit 1060 and converted into audio data, which are processed by audio data output processor 1080 for transmission to, for example, another cell phone via RF circuit 1010 or for output to memory 1020 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 1070, so that wireless broadband Internet access is provided for the user. Although fig. 3 shows a WiFi module 1070, it is understood that it does not belong to the necessary constitution of the handset, and can be omitted entirely as required within the scope of not changing the essence of the invention.
Processor 1080 is the control center of the handset, connects the various parts of the entire handset using various interfaces and lines, and performs various functions and processes of the handset by running or executing software programs and/or modules stored in memory 1020, and invoking data stored in memory 1020, thereby performing overall monitoring of the handset. Optionally, processor 1080 may include one or more processing units; preferably, processor 1080 may integrate an application processor primarily handling operating systems, user interfaces, applications, etc., with a modem processor primarily handling wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1080.
The handset further includes a power source 1090 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 1080 by a power management system, such as to provide for managing charging, discharging, and power consumption by the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which will not be described herein.
In the embodiment of the present application, the processor 1080 included in the terminal further has the following functions:
s1, creating a database row list in a distributed database, wherein the database row list is used for recording the row number of the list;
s2, creating a histogram information table in the distributed database, wherein the histogram information table is used for recording the detailed information of each field histogram of the table;
s3, executing analysis instructions to update the table information, the line number information and the histogram information on each fragment in the distributed database to a database line number table and a histogram information table;
s4, when the CN layer has a requirement for creating the histogram, the database line table and the data information in the histogram information table are called to create the histogram.
The present application also provides a computer readable storage medium storing program code for executing any one of the methods for creating a distributed database histogram described in the foregoing embodiments.
In the embodiment of the application, a method, a device, equipment and a storage medium for creating a distributed database histogram are provided, by creating a database row list and a histogram information list in the distributed database, executing analysis instruction query and counting table information, row number information and histogram information on each slice in the distributed database, thereby updating the database row list and the histogram information list, loading the database row list and the histogram information list on a CN layer, and creating and displaying a histogram by integrating weight evaluation, so that the technical problem that the current database histogram creation cannot meet actual requirements due to the position distribution mode reasons of each table in the distributed database is solved, SQL statement execution logic is different from that of the traditional database, and histogram logic is changed.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be capable of operation in sequences other than those illustrated or described herein, for example. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (RandomAccess Memory, RAM), magnetic disk or optical disk, etc.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. A method for creating a histogram of a distributed database, comprising:
s1, creating a database row list in a distributed database, wherein the database row list is used for recording list rows;
s2, creating a histogram information table in the distributed database, wherein the histogram information table is used for recording the detailed information of each field histogram of the table;
s3, executing analysis instructions to update table information, line number information and histogram information on each fragment in the distributed database to the database line number table and the histogram information table;
s4, when the CN layer has a requirement for creating the histogram, the database line table and the data information in the histogram information table are called to create the histogram.
2. The method for creating a histogram of a distributed database according to claim 1, wherein said step S3 specifically includes:
and executing a first analysis instruction, so that table information, line number information and histogram information of different tables of different target databases in the distributed database are updated into the database line number table and the histogram information table.
3. The method for creating a histogram of a distributed database according to claim 1, wherein said step S3 specifically includes:
and executing a second analysis instruction, so that the table information, the line number information and the histogram information of all the tables of one target database in the distributed database are updated into the database line number table and the histogram information table.
4. The distributed database histogram creation method of claim 1, further comprising:
creating a timing update task so that the analysis instructions are executed at preset time intervals or target time points.
5. The distributed database histogram creation method of claim 1, further comprising:
executing the step S3 when one CN node in the CN layer initiates an analysis instruction;
and the CN node sends a message to a management node, and the management node broadcasts the message to other CN nodes in the CN layer, so that the other CN nodes update the local cache according to the database row list and the histogram information list.
6. A distributed database histogram creation apparatus, comprising:
the first creating unit is used for creating a database row list in the distributed database, wherein the database row list is used for recording the number of the table rows;
a second creating unit configured to create a histogram information table in the distributed database, the histogram information table being used to record the individual field histogram detailed information of the table;
the execution unit is used for executing analysis instructions to update the table information, the line number information and the histogram information on each fragment in the distributed database to the database line number table and the histogram information table;
and the histogram creation unit is used for calling the database line table and the data information in the histogram information table to create a histogram when the histogram creation requirement exists in the CN layer.
7. The distributed database histogram creation apparatus according to claim 6, wherein the execution unit is specifically configured to:
and executing a first analysis instruction, so that table information, line number information and histogram information of different tables of different target databases in the distributed database are updated into the database line number table and the histogram information table.
8. The distributed database histogram creation apparatus according to claim 6, wherein the execution unit is specifically configured to:
and executing a second analysis instruction, so that the table information, the line number information and the histogram information of all the tables of one target database in the distributed database are updated into the database line number table and the histogram information table.
9. A distributed database histogram creation apparatus, the apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the distributed database histogram creation method of any of claims 1-5 according to instructions in the program code.
10. A computer readable storage medium for storing program code for performing the distributed database histogram creation method of any one of claims 1-5.
CN202311847863.8A 2023-12-29 2023-12-29 Distributed database histogram creation method, device, equipment and storage medium Pending CN117807132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311847863.8A CN117807132A (en) 2023-12-29 2023-12-29 Distributed database histogram creation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311847863.8A CN117807132A (en) 2023-12-29 2023-12-29 Distributed database histogram creation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117807132A true CN117807132A (en) 2024-04-02

Family

ID=90423385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311847863.8A Pending CN117807132A (en) 2023-12-29 2023-12-29 Distributed database histogram creation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117807132A (en)

Similar Documents

Publication Publication Date Title
CN108156508B (en) Barrage information processing method and device, mobile terminal, server and system
CN110597793A (en) Data management method and device, electronic equipment and computer readable storage medium
CN104516886A (en) Method, mobile terminal and server for displaying data analysis result
US10757060B2 (en) Message notification method and terminal
CN114282169A (en) Abnormal data detection method and related device
CN116303085A (en) Test reason analysis method, device, equipment and storage medium
CN116468382A (en) RPA robot flow management method, device, equipment and storage medium
CN115617899A (en) Data visualization processing method, device, equipment and storage medium
CN117807132A (en) Distributed database histogram creation method, device, equipment and storage medium
CN114840565A (en) Sampling query method, device, electronic equipment and computer readable storage medium
CN112711516A (en) Data processing method and related device
CN117743355A (en) Concurrent updating method, device and equipment for distributed database and storage medium
CN110809234A (en) Figure category identification method and terminal equipment
CN117743015A (en) SQL fault positioning method, device, system and equipment
CN115565215B (en) Face recognition algorithm switching method and device and storage medium
CN116680292A (en) Data query method, device, equipment and computer readable storage medium
CN116777219A (en) Target enterprise risk assessment method, device, equipment and storage medium
CN117539460A (en) Data set editing processing method and system
CN116680188A (en) Data processing method, device, equipment and computer readable storage medium
CN116257503A (en) Data migration processing method, device, equipment and storage medium
CN116303086A (en) End-to-end testing method, configuration method, device, equipment and storage medium
CN116303646A (en) Cross-database data comparison method, device, equipment and storage medium
CN116069269A (en) Custom receipt printing method, device, equipment and storage medium
CN116303060A (en) ESB call request processing method, device, system, equipment and storage medium
CN117011023A (en) Full link regression data management method, device, equipment and storage medium

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