CN115630071A - Method, device and equipment for processing reverse connection in database - Google Patents

Method, device and equipment for processing reverse connection in database Download PDF

Info

Publication number
CN115630071A
CN115630071A CN202211337074.5A CN202211337074A CN115630071A CN 115630071 A CN115630071 A CN 115630071A CN 202211337074 A CN202211337074 A CN 202211337074A CN 115630071 A CN115630071 A CN 115630071A
Authority
CN
China
Prior art keywords
null
data
data block
target data
reverse connection
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
CN202211337074.5A
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.)
Beijing Oceanbase Technology Co Ltd
Original Assignee
Beijing Oceanbase Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Oceanbase Technology Co Ltd filed Critical Beijing Oceanbase Technology Co Ltd
Priority to CN202211337074.5A priority Critical patent/CN115630071A/en
Publication of CN115630071A publication Critical patent/CN115630071A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/221Column-oriented storage; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

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

Abstract

The embodiment of the specification discloses a method, a device and equipment for processing reverse connection in a database. The scheme comprises the following steps: acquiring a reverse connection to be executed; in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column; determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column; determining NULL statistical information recorded for the data block; if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards; and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.

Description

Method, device and equipment for processing reverse connection in database
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a method, an apparatus, and a device for processing a reverse connection in a database.
Background
Half-join fingers in the database: and only one side of the two connected data tables is output, and the other side of the two connected data tables is used for calculating output conditions. A subclass of hemiconcatenation is hereinafter called reverse concatenation, where the expression of the computation output condition is, for example, NOT IN, < > ALL, etc.
In practical applications, the anti-connection is more and more widely used, and therefore, a scheme capable of improving the performance of the anti-connection execution is needed to improve the performance of the database.
Disclosure of Invention
One or more embodiments of the present specification provide a method, an apparatus, a device, and a storage medium for processing a reverse connection in a database, so as to solve the following technical problems: there is a need for a solution that can improve the performance of the anti-join execution to improve database performance.
To solve the above technical problems, one or more embodiments of the present specification are implemented as follows:
one or more embodiments of the present specification provide a method for processing a reverse connection in a database, including:
acquiring a reverse connection to be executed;
in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column;
determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column;
determining NULL statistical information recorded for the data block;
if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards;
and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
One or more embodiments of the present specification provide an anti-join processing apparatus in a database, including:
the reverse connection acquisition module acquires reverse connection to be executed;
a data column determination module that determines, in the right table of the reverse connection, a data column relating to a connection condition of the reverse connection as a target data column;
a data block determination module for determining a plurality of data blocks into which the target data column is divided, each data block corresponding to one or more data rows in the target data column;
the statistical information determining module is used for determining NULL statistical information recorded for the data blocks;
a data block adjusting module, for adjusting the position of the data block in the target data column upwards if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0;
and the reverse connection execution module executes the reverse connection according to the adjusted target data column, and ends the execution process in advance when NULL in the adjusted target data column is scanned in the execution process.
One or more embodiments of the present specification provide an anti-connection processing apparatus in a database, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a reverse connection to be executed;
in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column;
determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column;
determining NULL statistical information recorded for the data block;
if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards;
and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
One or more embodiments of the present specification provide a non-transitory computer storage medium storing computer-executable instructions configured to:
acquiring a reverse connection to be executed;
in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column;
determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column;
determining NULL statistical information recorded for the data block;
if the NULL statistical information of the data block reflects that the number of the NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards;
and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
At least one technical scheme adopted by one or more embodiments of the specification can achieve the following beneficial effects: for the reverse connection, the NULL and non-NULL values are distinguished to be processed, for the NULL, the process of executing is considered to be ended in advance, so that the reverse connection, especially the semantics of the reverse connection sensitive to the NULL, is facilitated to be correctly realized, for the non-NULL values, the performance can be improved by adopting a processing mode such as hash connection, and the like, moreover, the data table is subjected to block storage and NULL information statistics, the condition of the number of NULL contained in the data block can be determined without scanning the data table, and the position of the data block with the number of NULL not equal to 0 is actively adjusted, so that the NULL can be scanned earlier when the reverse connection is executed, the executing process is ended in advance, therefore, the executing performance of the reverse connection is effectively improved, and the performance of the database is facilitated to be improved.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic flowchart of a method for processing a reverse connection in a database according to one or more embodiments of the present disclosure;
FIG. 2 is a graphical illustration of the effect of a NULL position on the time complexity of an anti-join execution as provided by one or more embodiments of the present disclosure;
FIG. 3 is a schematic diagram of one embodiment of the method of FIG. 1 in a practical application scenario provided in one or more embodiments of the present disclosure;
fig. 4 is a schematic diagram of data blocks before reordering in a practical application scenario provided in one or more embodiments of the present disclosure;
fig. 5 is a schematic diagram of reordered data blocks in an actual application scenario provided by one or more embodiments of the present disclosure;
fig. 6 is a schematic structural diagram of an anti-connection processing apparatus in a database according to one or more embodiments of the present disclosure;
fig. 7 is a schematic structural diagram of an anti-connection processing device in a database according to one or more embodiments of the present disclosure.
Detailed Description
The embodiment of the specification provides a method, a device, equipment and a storage medium for processing reverse connection in a database.
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
Currently, the inverse connection is generally processed based on the cartesian product of Nested Loops, but this approach is inefficient. Based on this, the inventors considered processing the anti-join based on the hash join to improve efficiency, but there is also a problem IN that some expressions for calculating output conditions IN the anti-join are sensitive to NULL, for example, expressions based on NOT IN or < > ALL, whereas join conditions IN this case are difficult to process based on the hash join. In order to solve the problem, the inventor adopts a scheme for differentially processing the NULL value and the non-NULL value, so that the non-NULL value can be processed based on hash connection, and the non-NULL value is specially processed aiming at NULL, so that the execution process can be ended in advance, and the efficiency is improved.
The following description will be made in detail based on such a concept.
Fig. 1 is a schematic flowchart of a method for processing a reverse connection in a database according to one or more embodiments of the present disclosure. The process may be performed on a database-related device, such as a distributed database server, a database optimization server, or the like.
The process in fig. 1 comprises the following steps:
s102: and acquiring the reverse connection to be executed.
In one or more embodiments of the present description, a reverse connection is a NULL sensitive reverse connection, implemented, for example, based on at least one of the following expressions: NOT IN, < > ALL.
S104: in the right table of the reverse connection, a data column relating to a connection condition of the reverse connection is determined as a target data column.
The left table of the reverse connection is used for output, and the right table is used for calculating output conditions. The target data column directly relates to the output condition, and if there is NULL in the target data column, it is difficult to determine whether the output condition is satisfied at all, because the semantic of NULL is particularly uncertain, and may become an arbitrary value, which results in whether the output condition is satisfied or not.
S106: determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column.
In one or more embodiments of the present specification, the data columns in the right table are divided in advance for storage as data blocks.
Specifically, in the implementation of the storage of the database, data block division may be performed on data in advance, where the division is various, for example, division is performed based on a main key, and for example, each column is divided separately in a vertical direction. One of the purposes of partitioning includes: according to actual needs, statistics in some aspects is carried out on the divided data blocks in advance, so that the data can be directly read when the statistical data is needed to be used subsequently, original data does not need to be scanned immediately, and the efficiency is high.
It should be noted that if the pre-divided data blocks directly satisfy the requirement (for example, the data blocks are obtained by respectively longitudinally dividing the data columns), then when S106 is executed, the data block corresponding to the target data column may be directly selected from the pre-divided data blocks, and if the requirement is not directly satisfied (for example, the target data column and the non-target data column are blended to divide the data block), then when S106 is executed, the data block may need to be reprocessed and then used, in this case, the data block in S106 is not necessarily the data block originally divided in advance, and even if so, based on the pre-division and the statistical operation, the data can still be avoided from being rescanned to some extent, and the efficiency of the subsequent anti-concatenation execution performance can be improved.
For the purposes of this application, statistics include at least statistics on NULL-related information in a data block, the corresponding portion of the statistics is referred to as NULL statistics,
in one or more embodiments of the present specification, one or more target data columns are divided into a plurality of data blocks in a vertical direction, and in the case of a plurality of target data columns, the target data columns may be divided as a whole, or each column may be divided separately and then combined. The size of the data block partition is determined according to actual needs, and if the data block partition is based on the data volume, for example, the data block partition is divided into one data block of 2MB, for the application, the data block partition can be relatively large (which is helpful for improving the efficiency of data block reordering, certainly, the data block partition cannot be too large, otherwise, under the condition that NULL is in the lower part in the data block, the efficiency improvement effect is affected), so that the efficiency is more favorably improved.
S108: NULL statistic information recorded for the data block (at least one data block of a plurality of data blocks into which the target data column is divided) is determined.
In one or more embodiments of the present disclosure, the NULL statistic information can directly or indirectly reflect whether the number of NULLs included in the corresponding data block (i.e., the data block may include NULLs and include several NULLs) is 0 (0 indicates that the data block does not include NULLs), specifically, the NULL statistic information is, for example, the total number of NULLs included in the data block, a flag indicating whether the number of NULLs is 0 (assuming that a boolean bit is used, for example, a value of 1 indicates that the number of NULLs is not 0, and a value of 0 indicates that the number of NULLs is 0), the number of NULLs included in each column of the data block, and so on.
Further, the NULL statistic information may also contain more information, such as which data block contains the largest or smallest amount of NULL.
In one or more embodiments of the present disclosure, after the corresponding NULL statistic information is counted for each data block, and the count information is recorded in meta information (e.g., meta information of a corresponding storage layer or data table), the NULL statistic information recorded for the data block can be obtained by accessing the meta information, without accessing specific table data, thereby reducing data reading overhead.
S110: and if the NULL statistical information of the data block reflects that the number of the NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards.
In one or more embodiments of the present disclosure, if the NULL statistic information of a data block reflects that the number of NULLs contained in the data block is not 0, this indicates that there are NULLs in the target data column (or possibly NULLs, depending on the partitioning policy of the data block), and the existence of NULL is the uncertainty of the reverse connection output condition, so that in the case of NULL, the present application actively adjusts the position of the corresponding data block upward (e.g., to the uppermost position in the target data column) to meet NULL earlier in execution.
In practical applications, there may be a plurality of data blocks corresponding to the target data column and containing NULL data of different numbers from 0, in which case at least one of the data blocks may be adjusted up.
S112: and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
In one or more embodiments of the present disclosure, the adjustment to the target data column may be temporary, e.g., only for performing a reverse join, after which the pre-adjustment state may be restored. The adjustment may be performed not on the ground of the original data operation of the target data column, but on the scan order of the target data column, which is less costly and more efficient.
In one or more embodiments of the present specification, the process of ending execution in advance may further include: no data lines are returned as corresponding execution results, and thus the semantics of anti-concatenation, which is sensitive to NULL, can be complied with, helping to avoid giving unreliable execution results.
When the non-NULL value in the adjusted target data column is scanned, the non-NULL value can be processed in a hash connection or a Nested Loops manner. Hash-join-based processing can reduce the computational temporal complexity from O (n × n) to O (n) compared to Nested Loops-based processing, some embodiments below assume that hash-join approaches are used to handle non-NULL values.
For NULL, the scheme makes the reverse connection execution possible to further end in advance by adjusting NULL up, and on the basis of O (n), the time complexity may be further reduced, and even the time complexity may be reduced to O (n). Whether the temporal complexity can be reduced from O (n) to O (1) depends on the timing of the first NULL read from the target data column during scanning. If NULL is read at a very low position, then the temporal complexity is O (n); if NULL is read at the top right table, then the temporal complexity is O (1).
More intuitively, referring to fig. 2, fig. 2 is a schematic diagram illustrating the effect of a NULL position on the time complexity of an anti-join execution according to one or more embodiments of the present disclosure.
In fig. 2, a target data column, denoted as c1, is exemplarily shown, and it is assumed that there are 1T rows of data in c1, as indicated by the row number. On the left side in fig. 2, NULL appears at a position very lower in c1, and it is necessary to wait until all the previous data have been processed before processing NULL, and the time complexity is O (n). On the right side in fig. 2, NULL appears at a position very upper in c1, NULL is processed when the third row data is processed, and the time complexity is O (1). Therefore, the scheme actively controls reading NULL as early as possible, and is beneficial to greatly improving the performance of anti-connection execution under the scene of large data volume and less NULL.
By the method of fig. 1, for the reverse concatenation, NULL and non-NULL values are distinguished to be processed, for NULL, the process of executing is considered to be ended in advance, so that the semantics of reverse concatenation, especially reverse concatenation sensitive to NULL, can be correctly realized, for non-NULL values, the efficiency can be improved by adopting a processing mode such as hash concatenation, and in addition, the data table is subjected to block storage and NULL information statistics, so that the condition of the number of NULL contained in the data block can be determined without scanning the data table, and the position of the data block with the number of NULL not 0 is actively adjusted, so that NULL can be scanned earlier when the reverse concatenation is executed, the executing process is ended in advance, therefore, the executing efficiency of reverse concatenation is effectively improved, and the database performance is improved.
Based on the method of fig. 1, some specific embodiments and extensions of the method are also provided in the present specification, and the description is continued below.
In one or more embodiments of the present specification, for a plurality of data blocks corresponding to a target data column, there may be a case where the number of NULLs included in more than one data block (referred to as a target data block) at a time is not 0, and the distribution and specific positions of the NULLs in different target data blocks are uncertain. If a target data block contains a greater number of NULLs, the probability that there are more top NULLs in the target data block will also increase accordingly, and based on this, the target data block containing the greatest number of NULLs may be adjusted to the top most position. In this regard, the present application illustratively employs a manner of reordering data blocks to achieve such an objective.
Specifically, for example, when the NULL information is counted in advance, the NULL number is counted specifically, and the NULL statistical information at least includes the NULL number included in the corresponding data block. Subsequently, in step S110, a plurality of data blocks (some of the data blocks may be specifically selected to operate in a descending order of the number of NULL, so as to reduce the sorting overhead, for example, a target data block whose number of NULL is not 0) are reordered, so as to obtain an adjusted target data column, where the number of NULL included in the first M reordered data blocks is not 0,M and is not less than 1, and then the first data block includes the largest number of NULL, and is located at the uppermost position in the target data column after adjustment. In a scenario where a small amount of NULL is included in corresponding big data, the value of M may be small, which is helpful for improving the reordering speed, and in particular, the speed of encountering NULL can be greatly improved compared with the unadjusted case, so that the advantages of the scheme can be particularly reflected.
In one or more embodiments of the present description, when pre-counting, if the processing power is sufficient, for a data block containing a NULL, the uppermost position of the NULL in the data block may be counted and recorded. Then, in the adjustment, the uppermost position of each target data block may be adjusted upward relative to the upper target data block, and the positions of the other target data blocks may not be adjusted.
As described above, more intuitively, one or more embodiments of the present disclosure provide a schematic diagram of an implementation of the method in fig. 1 in a practical application scenario, as shown in fig. 3, and described with reference to fig. 4 and fig. 5.
The scheme in fig. 3 comprises the following steps:
s302: in the implementation of the storage of the database, the data block division of the data is implemented in advance, and the corresponding statistical information such as the number of NULL (represented by a NULL Count field) and the like is recorded for each data block in the meta information.
S304: in the SQL calculation layer implementation of the database, a data block iterator is constructed in advance and is specially responsible for sequentially arranging data blocks to control the scanning sequence.
S306: and for the inverse connection sensitive to the NULL to be executed, determining each data block in the corresponding target data column in the right table, and reading the NULL number respectively contained in each data block by accessing the meta information. Referring to fig. 4, fig. 4 is a schematic diagram of data blocks before reordering in a practical application scenario provided by one or more embodiments of the present disclosure. It can be seen that the target data sequence is divided into n data blocks (i.e., n pieces of data in the vertical direction, which are respectively referred to as blocks 1 to n from top to bottom), wherein the number of NULL contained in Block 3 is 1, the number of NULL contained in Block m is 3, and the number of NULL contained in the remaining blocks m is 0.
S308: before performing the inverse join to start scanning the data, the data blocks are reordered by a data block iterator in descending order of the NULL number. Referring to fig. 5, fig. 5 is a schematic diagram of reordered data blocks in an actual application scenario provided by one or more embodiments of the present disclosure. It can be seen that after reordering, block m has the largest number of NULLs and therefore has been adjusted upward to the uppermost position, and Block 3 has the second largest number of NULLs and has been adjusted to the second uppermost position accordingly.
In addition, as the number of blocks may be large, in order to reduce the overhead of sorting all the blocks based on the number of NULL, instead of performing full sorting, only the number of NULL included in the blocks is traversed, after a set number (the set number is not less than 1, for example, 3) of data blocks whose number of NULL included is not 0 is obtained by traversal, the traversal is stopped, and the positions of the set number of data blocks in the target data column are adjusted upward so as to perform preferential scanning.
S310: and based on the reordered data blocks, scanning data in sequence to execute the reverse connection, and finishing the execution in advance when the first NULL is scanned. Then, the first scanned Block is Block m, and when the first NULL is scanned in Block m, execution can be ended in advance, so that subsequent blocks 3, block 1,. And so on do not need to be scanned again, thereby saving the calculation overhead and improving the execution performance.
Based on the same idea, one or more embodiments of the present specification further provide apparatuses and devices corresponding to the above-described method, as shown in fig. 6 and fig. 7. The apparatus and device are capable of performing the above method and associated alternatives accordingly.
Fig. 6 is a schematic structural diagram of an anti-connection processing apparatus in a database according to one or more embodiments of the present specification, where the apparatus includes:
a reverse connection obtaining module 602, which obtains a reverse connection to be executed;
a data column determination module 604 that determines, in the right table of the reverse connection, a data column relating to a connection condition of the reverse connection as a target data column;
a data block determination module 606 for determining a plurality of data blocks into which the target data column is divided, each of the data blocks corresponding to one or more data rows in the target data column;
a statistic information determining module 608, which determines NULL statistic information recorded for the data block;
a data block adjusting module 610, configured to adjust a position of the data block in the target data column upwards if the NULL statistic information of the data block indicates that the number of NULLs included in the data block is not 0;
and a reverse connection executing module 612, configured to execute the reverse connection according to the adjusted target data column, and in the executing process, when a NULL in the adjusted target data column is scanned, end the executing process in advance.
Optionally, the method further comprises:
a data block dividing module 614, configured to divide the data columns in the right table into data blocks in advance for storage before the reverse connection to be executed is obtained; a NULL statistic module 616, for each data block, counting corresponding NULL statistic information, and recording the count information in the meta information;
the statistical information determining module 608 obtains NULL statistical information recorded for the data block by accessing the meta information.
Optionally, the NULL statistic information includes the number of NULLs contained in the corresponding data block;
the data block adjusting module 610 reorders the data blocks according to the descending order of the NULL number, so as to obtain the adjusted target data sequence;
wherein, the number of NULLs contained in the first M reordered data blocks is not 0,M and is not less than 1.
Optionally, the NULL statistic information includes the number of NULLs included in the corresponding data block;
the data block adjusting module 610 traverses the number of NULL contained in the plurality of data blocks, and stops traversing after a set number of data blocks containing NULL not less than 0 are obtained by traversing, where the set number is not less than 1;
and adjusting the positions of the set number of the data blocks in the target data column upwards.
Optionally, the anti-concatenation execution module 612, during the execution, when a non-NULL value in the adjusted target data column is scanned, processes the non-NULL value through hash concatenation.
Optionally, the inverse connection executing module 612 ends the executing process in advance, and further includes: no data line is returned as a result of the corresponding execution.
Optionally, the inverse connection is a NULL sensitive inverse connection.
Optionally, the anti-join is implemented based on at least one of the following expressions: NOT IN, < > ALL.
Fig. 7 is a schematic structural diagram of an anti-connection processing device in a database according to one or more embodiments of the present specification, where the device includes:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to:
acquiring a reverse connection to be executed;
in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column;
determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column;
determining NULL statistical information recorded for the data block;
if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards;
and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
Based on the same idea, one or more embodiments of the present specification further provide a non-volatile computer storage medium storing computer-executable instructions configured to:
acquiring a reverse connection to be executed;
in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column;
determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column;
determining NULL statistical information recorded for the data block;
if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards;
and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is an integrated circuit whose Logic functions are determined by a user programming the Device. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, respectively. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the device, and the nonvolatile computer storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and for the relevant points, reference may be made to the partial description of the embodiments of the method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is merely one or more embodiments of the present disclosure and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments of the present description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of the claims of the present specification.

Claims (17)

1. A method for processing reverse connection in a database comprises the following steps:
acquiring a reverse connection to be executed;
in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column;
determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column;
determining NULL statistical information recorded for the data block;
if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards;
and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
2. The method of claim 1, prior to said obtaining the reverse connection to be performed, the method further comprising:
dividing the data columns in the right table into data blocks in advance for storage; and the number of the first and second antennas is increased,
for each data block, corresponding NULL statistical information is counted and recorded in the meta information;
the determining the NULL statistical information recorded for the data block specifically includes:
obtaining NULL statistical information recorded for the data block by accessing the meta information.
3. The method of claim 1, wherein the NULL statistic information includes the number of NULLs contained in its corresponding data block;
if the NULL statistical information of the data block reflects that the number of NULLs included in the data block is not 0, adjusting the position of the data block in the target data column upwards specifically includes:
reordering the plurality of data blocks according to the descending order of the NULL number, thereby obtaining the adjusted target data column;
wherein, the number of NULLs contained in the first M reordered data blocks is not 0,M and is not less than 1.
4. The method of claim 1, wherein the NULL statistic information includes the number of NULLs contained in its corresponding data block;
if the NULL statistic information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards, specifically including:
traversing the number of NULLs contained in the plurality of data blocks, and stopping traversing after a set number of data blocks containing NULLs not less than 0 are obtained through traversing, wherein the set number is not less than 1;
and adjusting the positions of the set number of the data blocks in the target data column upwards.
5. The method of claim 1, wherein the performing the reverse join specifically comprises:
in the performing, when a non-NULL value in the adjusted target data column is scanned, the non-NULL value is processed by hash concatenation.
6. The method of claim 1, said prematurely ending said executing process further comprising:
no data line is returned as a result of the corresponding execution.
7. The method of any one of claims 1 to 6, the anti-join being a NULL sensitive anti-join.
8. The method of claim 7, wherein the anti-concatenation is implemented based on at least one of the following: NOT IN, < > ALL.
9. An anti-join processing apparatus in a database, comprising:
the reverse connection acquisition module acquires reverse connection to be executed;
a data column determination module that determines, in the right table of the reverse connection, a data column relating to a connection condition of the reverse connection as a target data column;
a data block determination module for determining a plurality of data blocks into which the target data column is divided, each data block corresponding to one or more data rows in the target data column;
the statistical information determining module is used for determining NULL statistical information recorded for the data blocks;
a data block adjusting module, for adjusting the position of the data block in the target data column upwards if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0;
and the reverse connection execution module executes the reverse connection according to the adjusted target data column, and ends the execution process in advance when NULL in the adjusted target data column is scanned in the execution process.
10. The apparatus of claim 9, further comprising:
the data block dividing module is used for dividing the data columns in the right table into data blocks in advance for storage before the reverse connection to be executed is acquired; the NULL statistical module is used for counting corresponding NULL statistical information aiming at each data block and recording the corresponding NULL statistical information in the meta information;
and the statistical information determining module is used for obtaining the NULL statistical information recorded for the data block by accessing the meta information.
11. The apparatus of claim 9, the NULL statistic information comprising a number of NULLs contained in its corresponding data block;
the data block adjusting module reorders the data blocks according to the descending order of the NULL number to obtain the adjusted target data column;
wherein, the number of NULLs contained in the first M reordered data blocks is not 0,M and is not less than 1.
12. The apparatus of claim 9, the NULL statistic information comprising a number of NULLs contained in its corresponding data block;
the data block adjusting module is used for traversing the number of NULLs contained in the data blocks, stopping the traversal after a set number of data blocks containing NULLs not less than 0 are obtained through the traversal, and the set number is not less than 1;
and adjusting the positions of the set number of the data blocks in the target data column upwards.
13. The apparatus of claim 9, the anti-concatenation execution module, during the execution, to process non-NULL values in the adjusted target data column by hash concatenation when the non-NULL values are scanned.
14. The apparatus of claim 9, the reverse connection execution module to end the executed procedure prematurely, further comprising: no data lines are returned as a result of the corresponding execution.
15. The apparatus of any one of claims 9 to 14, the anti-connection being a NULL sensitive anti-connection.
16. The apparatus of claim 15, wherein the anti-concatenation is implemented based on at least one of the following: NOT IN, < > ALL.
17. A reverse connection handling device in a database, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform:
acquiring a reverse connection to be executed;
in the right table of the reverse connection, determining a data column relating to the connection condition of the reverse connection as a target data column;
determining a plurality of data blocks into which the target data column is divided, wherein each data block corresponds to one or more data rows in the target data column;
determining NULL statistical information recorded for the data block;
if the NULL statistical information of the data block reflects that the number of NULLs contained in the data block is not 0, adjusting the position of the data block in the target data column upwards;
and executing the reverse connection according to the adjusted target data column, wherein in the executing process, when NULL in the adjusted target data column is scanned, the executing process is ended in advance.
CN202211337074.5A 2022-10-28 2022-10-28 Method, device and equipment for processing reverse connection in database Pending CN115630071A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211337074.5A CN115630071A (en) 2022-10-28 2022-10-28 Method, device and equipment for processing reverse connection in database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211337074.5A CN115630071A (en) 2022-10-28 2022-10-28 Method, device and equipment for processing reverse connection in database

Publications (1)

Publication Number Publication Date
CN115630071A true CN115630071A (en) 2023-01-20

Family

ID=84907714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211337074.5A Pending CN115630071A (en) 2022-10-28 2022-10-28 Method, device and equipment for processing reverse connection in database

Country Status (1)

Country Link
CN (1) CN115630071A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775652A (en) * 2023-06-19 2023-09-19 北京火山引擎科技有限公司 Data table processing method, device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775652A (en) * 2023-06-19 2023-09-19 北京火山引擎科技有限公司 Data table processing method, device and storage medium

Similar Documents

Publication Publication Date Title
KR102194074B1 (en) Blockchain-based data processing method and device
CN108845936B (en) AB testing method and system based on massive users
US11074246B2 (en) Cluster-based random walk processing
CN117312394B (en) A data access method, device, storage medium and electronic equipment
CN109376189A (en) Processing method, device and the equipment of batch data operation
CN111680472A (en) Table data processing method and device, computer equipment and readable storage medium
WO2025044317A1 (en) Method and apparatus for accelerating model training, storage medium, and electronic device
CN115630071A (en) Method, device and equipment for processing reverse connection in database
CN108021610A (en) Random walk, random walk method, apparatus and equipment based on distributed system
CN110908429B (en) Timer operation method and device
CN108733789B (en) Method, device and equipment for evolution of execution plan of database operation instruction
CN110096477B (en) Data storage method and device
CN116644090A (en) Data query method, device, equipment and medium
CN110032563B (en) Processing method and system of mismatch value and electronic equipment
CN116166614A (en) Log archiving method and device, storage medium and electronic equipment
CN110502551A (en) Data read-write method, system and infrastructure component
CN108153799B (en) Database access control method and device and database system
CN115563116A (en) Database table scanning method, device and equipment
CN115587107A (en) Data updating method, device, storage medium and equipment
WO2020192291A1 (en) Method and system for generating statistical information, and electronic device
CN116089434B (en) Data storage method and device, storage medium and electronic equipment
CN113641871B (en) Lock-free hashing method, device, equipment and medium
CN115098271B (en) Multithreading data processing method, device, equipment and medium
CN116232919A (en) Method and device for statistics of secret state data, storage medium and electronic equipment
CN109033201A (en) A kind of acquisition methods, device and the electronic equipment of file difference data

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