CN110413651A - The Connection inquiring method and device of Relational DBMS - Google Patents

The Connection inquiring method and device of Relational DBMS Download PDF

Info

Publication number
CN110413651A
CN110413651A CN201910742186.0A CN201910742186A CN110413651A CN 110413651 A CN110413651 A CN 110413651A CN 201910742186 A CN201910742186 A CN 201910742186A CN 110413651 A CN110413651 A CN 110413651A
Authority
CN
China
Prior art keywords
attribute
connection
tuple
returned
location information
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.)
Granted
Application number
CN201910742186.0A
Other languages
Chinese (zh)
Other versions
CN110413651B (en
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.)
Zhongke Yuanshu (beijing) Technology Co Ltd
Original Assignee
Zhongke Yuanshu (beijing) 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 Zhongke Yuanshu (beijing) Technology Co Ltd filed Critical Zhongke Yuanshu (beijing) Technology Co Ltd
Priority to CN201910742186.0A priority Critical patent/CN110413651B/en
Publication of CN110413651A publication Critical patent/CN110413651A/en
Application granted granted Critical
Publication of CN110413651B publication Critical patent/CN110413651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • 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)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of Connection inquiring method and devices of Relational DBMS, wherein, this method comprises: parsing the location information of the location information and the attribute to be returned that participate in the attribute of connection in outer, interior table from the dependency structure body that left and right plan executes node respectively;Respectively according to the location information for the attribute for participating in connection in outer, interior table and the location information for the attribute to be returned, all tuple datas of all tuple datas and the attribute to be returned that participate in the attribute of connection in appearance and Nei Biao are pulled from left and right plan children tree nodes, and are respectively stored in the first table and the second table, third table and the 4th table;The data in the first table and in third table are compared according to outer interior table condition of contact matching using unified function;Connection inquiring result is returned according to matching comparison result, scheduled connection type, second table and the 4th table.It can be reduced expense through the above scheme, accelerate the attended operation of Relational DBMS, improve system execution efficiency.

Description

The Connection inquiring method and device of Relational DBMS
Technical field
The present invention relates to database management technology field more particularly to a kind of Relational DBMSs (DBMS) Connection inquiring method and device.
Background technique
With the arrival of digital society, in various application scenarios, to transferring more frequently for mass data, to database plus The demand of speed processing is more extensive.
In relevant database, mainly using relational model come a group organization data, number is stored in row and column fashion According to.There is complicated relationships between multiple tables of data, moreover, the management of data is increasingly with the increase of tables of data quantity Complexity, the bottleneck of data manipulation also appear in the operation carried out to multiple tables.Wherein, Join attended operation is typical data Operation between table, for being matched from the row obtained in two or more tables in one of table with the row in another table Data.Attended operation may further be there are many type, comprising: interior connection INNER JOIN, outer connection OUTER JOIN, Left connection LEFT JOIN, right connection RIGHT JOIN are anti-to connect ANTI JOIN etc..The essential purpose of attended operation is provided to A new table is generated according to certain Data Matching relationship, still, different types of attended operation can return to different table results. For example, interior connection only returns to the data line of successful match common in two tables, and left connection can then return and specify category in appearance Property all rows, and Nei Biao and the interior table part that it fails to match are shown as empty.
Instantly in many relationship type DBMS, there are fixed query compiler and execution mechanism for attended operation.However, these There are some defects for mechanism, for example, there is no when the line index for assisted lookup, docking outside adds on the attribute wait connect Speed can be relatively difficult, and the efficiency for being connected operation is also relatively low.
Summary of the invention
The present invention provides a kind of Connection inquiring method and devices of Relational DBMS, to accelerate relationship type The attended operation of data base management system improves system execution efficiency.
In order to achieve the above object, the present invention is realized using following scheme:
According to an aspect of an embodiment of the present invention, a kind of Connection inquiring side of Relational DBMS is provided Method, comprising:
The left plan for obtaining Relational DBMS executes the information of node and the information of right plan execution node, Wherein, the information that the left plan executes node includes the attribute to be returned in appearance and the attribute for participating in connection, the right meter Drawing and executing the information of node includes the attribute to be returned in interior table and the attribute for participating in connection;
The dependency structure body of node and the dependency structure body of the right plan execution node are executed from the left plan respectively In, parse the location information of attribute that connection is participated in the appearance and the location information for the attribute to be returned and the interior table The location information of the middle attribute for participating in connection and the location information for the attribute to be returned;
According to the location information for the attribute for participating in connection in the appearance and the location information for the attribute to be returned, from described Left plan executes the children tree nodes in node and pulls the institute that participate in the attribute of connection in all tuple slot in the appearance There are all tuple datas of tuple data He the attribute to be returned, and is respectively stored in the first table and the second table;
According to the location information for the attribute for participating in connection in the interior table and the location information for the attribute to be returned, from described Right plan executes the children tree nodes in node and pulls the institute that participate in the attribute of connection in all tuple slot in the interior table There are all tuple datas of tuple data He the attribute to be returned, and is respectively stored in third table and the 4th table;
Using unified function according to the member in the condition of contact of the appearance and interior table matching first table Tuple data in group data and the third table, and matching comparison result is stored in the 5th table;
Connection inquiring knot is returned according to the 5th table, scheduled connection type, second table and the 4th table Fruit.
Other side according to an embodiment of the present invention provides a kind of Connection inquiring of Relational DBMS Device, comprising:
Nodal information acquiring unit, for obtain Relational DBMS left plan execute node information and Right plan executes the information of node, wherein it includes the attribute to be returned in appearance and ginseng that the left plan, which executes the information of node, With the attribute of connection, the information that the right plan executes node includes the attribute to be returned in interior table and the attribute for participating in connection;
Location information acquiring unit, for respectively from the left dependency structure body for planning to execute node and the right plan In the dependency structure body for executing node, the attribute for participating in the location information of the attribute of connection in the appearance and being returned is parsed Location information and the interior table in participate in connection attribute location information and the attribute to be returned location information;
Left plan children tree nodes data pull unit, for the location information according to the attribute for participating in connection in the appearance And the location information for the attribute to be returned, the children tree nodes in node, which are executed, from the left plan pulls owning in the appearance All tuple datas of the attribute of connection and all tuple datas for the attribute to be returned are participated in tuple slot, and are deposited respectively Storage is in the first table and the second table;
Right plan children tree nodes data pull unit, for the location information according to the attribute for participating in connection in the interior table And the location information for the attribute to be returned, the children tree nodes in node, which are executed, from the right plan pulls owning in the interior table All tuple datas of the attribute of connection and all tuple datas for the attribute to be returned are participated in tuple slot, and are deposited respectively Storage is in third table and the 4th table;
Attended operation unit, for being compared using unified function according to the matching of the condition of contact of the appearance and the interior table The tuple data in tuple data and the third table in first table, and matching comparison result is stored in the 5th table In;
As a result output unit, for according to the 5th table, scheduled connection type, second table and the described 4th Table returns to Connection inquiring result.
Another aspect according to an embodiment of the present invention provides a kind of computer readable storage medium, is stored thereon with The step of computer program, which realizes above-described embodiment the method when being executed by processor.
The Connection inquiring method of the Relational DBMS of the embodiment of the present invention, Relational DBMS Connection inquiring device and computer readable storage medium, by disposably taking out all of attribute to be compared in appearance and Nei Biao Tuple data, then be compared processing to these tuple datas with a unified function disposably returns and all meets connection The tuple serial number of condition can save the expense of acquisition plan nodal information and the expense of function call, to improve DBMS's The execution efficiency of attended operation.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.In the accompanying drawings:
Fig. 1 is the flow diagram of the Connection inquiring method of the Relational DBMS of one embodiment of the invention;
Fig. 2 is the process signal of the Connection inquiring method of the Relational DBMS of a specific embodiment of the invention Figure;
Fig. 3 is the key that in an of the invention specific embodiment in PostgreSQL kernel involved in NestJoinLoop algorithm The schematic diagram of data structure NestLoopState;
Fig. 4 is the implementation procedure schematic diagram of kernel function in a specific embodiment of the invention;
Fig. 5 is the structural schematic diagram of the Connection inquiring device of the Relational DBMS of one embodiment of the invention.
Specific embodiment
Understand in order to make the object, technical scheme and advantages of the embodiment of the invention clearer, with reference to the accompanying drawing to this hair Bright embodiment is described in further details.Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but simultaneously It is not as a limitation of the invention.
Inventor has found that defect in the prior art is due to wait connect when carrying out the research of database speeding scheme Attribute on there is no for assisted lookup line index when, DBMS searched using sequential scan by the way of some attribute correspondence Tuple values only take a tuple to be compared processing every time and in sequential scan.Because from the executive plan section of database The expense that practical tuple data is obtained in point is bigger, and the function carried by database kernel is needed to realize.This mode When executing in database kernel, time and function call expense are all very big, judge to close between data line with the presence or absence of matching The process of system may reach the time complexity of square grade.Therefore, it is relatively difficult to lead to dock external speeding scheme, integrally connects The efficiency for connecing operation is relatively low.
In order to solve drawbacks described above of the existing technology, inventor is based on above-mentioned discovery, by how studying to each The method of table all sequential scan access evidences optimizes, and proposes a kind of Connection inquiring side of Relational DBMS Method.
The specific embodiment of the Connection inquiring method to Relational DBMS of the invention is carried out below It is described in detail.
Fig. 1 is the flow diagram of the Connection inquiring method of the Relational DBMS of one embodiment of the invention. As shown in Figure 1, the Connection inquiring method of the Relational DBMS of some embodiments may include following steps S110 extremely Step S160.Those steps can be to the inquiry of execution attended operation in existing Relational DBMS (DBMS) Journey optimizes.
Step S110: the left plan for obtaining Relational DBMS executes the information of node and right plan executes section The information of point, wherein the information that the left plan executes node includes the attribute of the attribute to be returned in appearance and participation connection, The information that the right plan executes node includes the attribute to be returned in interior table and the attribute for participating in connection.
It executes and is related in existing Relational DBMS (for example, postgreSQL, MySQL, ORACLE etc.) When the inquiry of attended operation, the available relevant information that node and right plan execution node are executed to left plan, for example, accordingly Table, corresponding structural body etc..Wherein, left plan executes node corresponding to appearance, and right plan executes node and corresponds to interior table.In In appearance and Nei Biao, tuple and attribute can respectively refer to the row and column in table.
The attribute to be returned and the attribute for participating in connection can be identified with the identification information of attribute, for example, attribute title, Code name or location index;Wherein, the attribute for participating in connection can be the attribute for referring to that appearance and Nei Biao associate, example Such as, existing attribute in Nei Biao and appearance;The attribute to be returned in the attribute and Nei Biao to be returned in appearance can be User needs the attribute obtained, is also possible to the attribute for needing to be compared or be mapped.
For example, appearance student includes attribute name and attribute sno, interior table sc include attribute sno and attribute cno, to Appearance student and Nei Biao sc are connected, the attribute for needing to return in appearance student is name, is needed in interior table sc The attribute of return is cno, then the attribute that connection is participated in appearance student and Nei Biao sc is sno, and condition of contact is appearance Attribute sno in student is equal to the attribute sno in interior table sc.
Step S120: the dependency structure body of node and the phase of the right plan execution node are executed from the left plan respectively Close structural body in, parse participated in the appearance connection attribute location information and the attribute to be returned location information and The location information of the attribute of connection and the location information for the attribute to be returned are participated in the interior table.
In other words, the position that the attribute of connection is participated in appearance is parsed from the dependency structure body that left plan executes node The location information for the attribute to be returned in information and appearance, and interior table is parsed from the dependency structure body that right plan executes node The location information for the attribute to be returned, above-mentioned two resolving are unlimited in the location information and Nei Biao of the middle attribute for participating in connection Surely the sequencing executed.
For appearance and Nei Biao, the location information of attribute and the location information for the attribute to be returned for participating in connection can be used Location index indicates.By taking the DBMS of postgreSQL as an example, the left plan executes the dependency structure body and the right meter of node Drawing and executing the dependency structure body of node can be structural body ps_ProjInfo;In appearance student, the category of connection is participated in Property student.sno location information index of reference position indicate, for example, be 0, the position for the attribute student.name to be returned Information index of reference position indicates, for example, being 1;In appearance sc, the location information index of reference position of the attribute sc.sno of connection is participated in Expression is set, for example, being 0, the location information index of reference position for the attribute sc.cno to be returned is indicated, for example, being 1.
Before above-mentioned steps S120, the method for each embodiment can also comprise determining whether that left and right plan executes node In the step of can not carrying out line index scanning (generally require at this time carry out sequential scan).It specifically, can be outer by judging Whether the attribute for needing to return in table is major key to judge that left plan executes in node with the presence or absence of line index scanning mode, can be with Judge to sweep in right plan execution node with the presence or absence of line index by the way that whether the attribute for needing to return in table in judging is major key Retouch mode.
In some embodiments, only in the case where left and right plan, which executes node, can not carry out line index scanning, Above-mentioned steps S120 is executed, is optimized with the sequential scan mode that this can may be used for existing DBMS, the company of raising Connect the efficiency of operation.Illustratively, before above-mentioned steps S120, the method for each embodiment can be with comprising steps of S170, really The fixed left plan executes node and the right plan executes node and line index scanning mode is not present.In the present embodiment, lead to Crossing determination can not carry out just executing subsequent step when line index scanning, can pointedly solve existing DBMS using sequential scan The low problem of joint efficiency caused by mode.
In other embodiments, if left and right plan executes at least one in node and can carry out line index scanning, still So operation is attached by the way of the line index scanning in existing DBMS.Illustratively, before above-mentioned steps S120, respectively The method of embodiment can be comprising steps of S180, determining that the left plan executes node and/or the right plan executes section Point there are in the case where line index scanning mode, according to left plan executes the information of node and right plan execute the information of node into Every trade index scanning, obtains Connection inquiring result.In the present embodiment, subsequent company can be being carried out in such a way that line index scans In the case where connecing operation, the preferential inquiry that operation is attached by the way of line index scanning can be improved as far as possible with this The efficiency of Connection inquiring.
Step S130: believed according to the position of the location information for the attribute for participating in connection in the appearance and the attribute to be returned Breath, connection will be participated in by pulling from the children tree nodes in the left plan execution node in all tuple slot in the appearance All tuple datas of attribute and all tuple datas for the attribute to be returned, and it is respectively stored in the first table and the second table.
Wherein, step S130 is drawn primarily directed to left plan children tree nodes (left plan executes the children tree nodes in node) Take the tuple data in tuple slot.It can be according to the location information for the attribute for participating in connection in appearance from left plan children tree nodes Pull to be participated in all tuple slot in appearance connection attribute all tuple datas, by pull to participate in connection All tuple datas of attribute are stored in the first table (for example, the table for being named as dblib_input_outer);According in appearance The location information for the attribute to be returned pulls the attribute to be returned in all tuple slot in appearance from left plan children tree nodes All tuple datas, all tuple datas of the attribute to be returned pulled are stored in the second table (for example, being named as The table of dblib_outer_output_datums) in, wherein pull to participate in connection attribute all tuple datas when Tuple slot in appearance is corresponding with the tuple slot in appearance when all tuple datas for pulling the attribute to be returned.
Wherein, multiple tuple slot be may include in appearance, it can be in such a way that circulation pulls from each in appearance The tuple data that participate in the attribute of connection is pulled in a tuple slot, then pulls the attribute to be returned from tuple slot Tuple data.
In the embodiment, can disposably obtain in appearance the tuple data in need for participating in comparing, that is, join in appearance With the tuple data of the attribute of connection.It can be in order in subsequent step S150, using the unified internal table of function and outer with this The tuple data of table is compared.
Step S140: believed according to the position of the location information for the attribute for participating in connection in the interior table and the attribute to be returned Breath, connection will be participated in by pulling from the children tree nodes in the right plan execution node in all tuple slot in the interior table All tuple datas of attribute and all tuple datas for the attribute to be returned, and it is respectively stored in third table and the 4th table.
Wherein, step S140 is drawn primarily directed to right plan children tree nodes (right plan executes the children tree nodes in node) Take the tuple data in tuple slot.It can be according to the location information for the attribute for participating in connection in interior table from right plan children tree nodes Pull to be participated in all tuple slot in interior table connection attribute all tuple datas, by pull to participate in connection All tuple datas of attribute are stored in third table (for example, the table for being named as dblib_input_inner);According in interior table The location information for the attribute to be returned pulls the attribute to be returned in all tuple slot in appearance from right plan children tree nodes All tuple datas, all tuple datas of the attribute to be returned pulled are stored in the 4th table (for example, being named as The table of dblib_inner_output_datums) in, wherein pull to participate in connection attribute all tuple datas when Tuple slot in interior table is corresponding with the tuple slot in interior table when all tuple datas for pulling the attribute to be returned.
Wherein, multiple tuple slot be may include in interior table, it can be in such a way that circulation pulls from each in interior table The tuple data that participate in the attribute of connection is pulled in a tuple slot, then pulls the attribute to be returned from tuple slot Tuple data.
In the embodiment, can disposably obtain in interior table the tuple data in need for participating in comparing, that is, join in interior table With the tuple data of the attribute of connection.It can be in order in subsequent step S150, using the unified internal table of function and outer with this The tuple data of table is compared.
Step S150: using unified function according to the condition of contact of the appearance and interior table matching more described first The tuple data in tuple data and the third table in table, and matching comparison result is stored in the 5th table.
Wherein, the condition of contact of the appearance and the interior table can be to prepare or start in existing DBMS to execute and be related to It is directly obtained when the inquiry of attended operation, for example, can be using one or more of attribute existing in appearance and Nei Biao as ginseng With the attribute of connection, and can be participated in using in appearance connection attribute and Nei Biao in participate in connection attribute it is equal as the appearance With the condition of contact of the interior table.Above-mentioned matching result may include tuple data in first table of successful match and described Information of the tuple that tuple data in third table is constituted to index.
In step S150, since all tuple datas of the attribute of the participation connection in required appearance have all been drawn It takes out and is stored in the first table, all tuple datas of the attribute of the participation connection in required interior table have all pulled Out and be stored in third table, in addition, be carry out matching comparison using unified function (such as unified kernel function), so Linear function need to only be carried out and call the comparison that can be completed to all tuple datas in the first table and third table, so as to keep away Exempt from every carry out once relatively with regard to calling linear function, so this programme can be reduced shared by the expense and function call of function call Therefore execution efficiency low problem when existing DBMS is attached operation is able to solve with the expense of time.
In some embodiments, it can use kernel function and carry out matching comparison.Illustratively, step S150, more Specifically may include step, the tuple data in the tuple data and the third table in first table is input to by: S151 Kernel function, to match the tuple in first table one by one according to the condition of contact of the appearance and the interior table Tuple data in data and the third table, the tuple data for obtaining meeting the condition of contact is to corresponding tuple to index Information is stored in the 5th table as matching comparison result.
Wherein, kernel function can be the kernel function that this method is added in DBMS source code, and kernel can be called to carry out Compare calculating.In the present embodiment, a kernel function can be called, then kernel function is by the tuple data in the first table It is successively compared with the tuple data in third table, comparison procedure circulation executes, specifically, for example, reading in the first table One tuple data, with each tuple data in third table once compared with, then read next tuple data in the first table, then With each tuple data in third table once compared with.In this way, by calling a kernel function that can complete to own The comparison of data greatly reduces the expense for the comparison function for constantly calling DBMS included.
In other embodiments, it can use external software or hardware carry out the acceleration of matching comparison.Illustratively, above-mentioned Step S151 or above-mentioned steps S150, more specifically, it may include step: S1511, it will be according to the appearance and the interior table Condition of contact match the set of procedures of the tuple data in first table and the tuple data in the third table at Kernel function interface obtains meeting institute to carry out matching comparison using external software or hardware-accelerated execution kernel function The tuple data of condition of contact is stated to corresponding tuple to index information.
Wherein, which can be parallel execution algorithm, which can be multiple CPU.Utilize the external software Or hardware, for example, the comparison of multipair tuple can be handled simultaneously by the way of multi -CPU multithreading or list CPU parallel computation Process.Input data when integrated kernel function interface mainly can be compared calculating for the external software or hardware Port case, data entry mode, by required data, for example, the tuple data in tuple data and third table in the first table, Including condition of contact, it is input to external software or hardware via integrated interface, and the interface can be can receive outside Software or the calculated result of hardware output.
In the embodiment, faster calculation can use by integrated kernel function interface and (such as hold parallel Row) it is executed using kernel function and compares calculating process, to further increase the efficiency compared.
Step S160: it is returned and is connected according to the 5th table, scheduled connection type, second table and the 4th table Connect query result.
Matching comparison result is stored in above-mentioned 5th table, specifically, it may include the index of one or more tuples pair is believed Breath, such as tuple serial number, for each tuple to may include corresponding two tuple datas, which may include appearance In to participate in connection attribute tuple data and match the category that participate in connecting in consistent interior table with the tuple data The tuple data of property.In other words, storing in the 5th table will participate in connecting in first table that meet condition of contact, corresponding Attribute data where tuple information and third table in participate in connection attribute data where tuple information.
Connection type may include interior connection, left connection, right connection, anti-connection etc., can or join algorithm different because of DBMS Difference and it is different.In some embodiments, the tuple data pair for meeting the condition of contact is stored in above-mentioned 5th table In the case that corresponding tuple is to information, for example, in the embodiment that above-mentioned steps S151 is applicable in, it is different according to connection type, Above-mentioned steps S160, more specifically, it may include step: S161, in the case where the connection type is interior connection, according to described Meet the tuple data of the condition of contact in 5th table to corresponding tuple to index information, from second table and described Four tables obtain corresponding tuple data, and return to the tuple data of acquisition;S162 is left connection, right company in the connection type Connect or it is counter connect in the case where, supplement does not meet the condition of contact to the appearance tuple that it fails to match in the 5th table Information, and in corresponding store list cell group information position setting it fails to match mark, to update the 5th table, then According to updated 5th table, the tuple data for needing to return is obtained from second table and the 4th table, to generate Connection inquiring result is returned.
Above-mentioned steps S161 and step S162 in no particular order, only define different type connection type, and corresponding returns The mode for returning query result will be different.
For example, in above-mentioned steps S161, due to needing to return in the interior table and appearance of interior connection request return successful match Attribute tuple data, so, in the 5th table include these data information in the case where, can be directly according to the 5th table In index information from the second table and the 4th table respectively read needed for return attribute tuple data.
For another example in above-mentioned steps S162, since left connection or right connection need to return in all appearances and need to return Attribute tuple data and corresponding interior table in the tuple data of attribute that needs to return, wherein for the number of successful match According to the tuple data for the attribute for needing to return in interior table is that original tuple data can return to the data pair that it fails to match Specific data (indicating that it fails to match) returns to null value.Data are connected for counter, need to return to the need in the appearance that it fails to match The tuple data for the attribute to be returned.In short, being left connection, right connection, anti-connection for connection type, comprising eligible Tuple return may be unable to satisfy to current 5th table of information require, therefore S162 can be to the 5th table through the above steps Data are updated, with data needed for polishing.In particular, it is desirable to the attribute to be returned in the appearance of complementary matching failure The information of tuple data to the 5th table, and to the information of the tuple data in the appearance of supplement it is corresponding in the information of data of table set It is set to the mark that it fails to match, such as unifying identifier is -1, it is seen that the information of the corresponding data of interior table is -1 in the 5th table, then marks It fails to match for knowledge.
In further embodiment, in above-mentioned steps S162, that is, according to updated 5th table, from described second Table and the 4th table obtain the tuple data for needing to return, and are returned with generating Connection inquiring result, more specifically, can wrap Including step: S1621 is left connection or in the case where right connection in the connection type, according to updated 5th table, from Second table obtains all tuple datas, correspondingly, the tuple data for meeting the condition of contact is obtained from the 4th table, And there is no the attribute to be returned of the tuple of successful match to return to null value in second table, generate Connection inquiring result into Row returns;S1622, in the case where the connection type is anti-connection, according to updated 5th table, from described second Table obtains the appearance tuple data for not meeting the condition of contact, generates Connection inquiring result and is returned.
In above-mentioned steps S1621, the data for the attribute that all appearances need to return are contained in updated 5th table Information, it is corresponding, contain in interior table the information of the tuple data of successful match and it fails to match mark, it is possible to for a left side The connection type of connection or right connection returns to the member in the tuple data and corresponding interior table for the attribute that all appearances need to return Group data or corresponding can identify according to it fails to match return to sky.In above-mentioned steps S1622, after having updated the 5th table, wherein Information comprising all tuple datas that it fails to match, it is possible to successively return and need to return in the appearance and Nei Biao that it fails to match The tuple data of the attribute returned.
In other embodiments, if the matching comparison result stored in existing 5th table, can directly execute State step S160 output Connection inquiring result.Illustratively, before above-mentioned steps S120, method shown in FIG. 1 may also include Step: S190 determines that there is no the matching ratios of the tuple data in the tuple data and the third table in first table Relatively result.In the embodiment, however, it is determined that there is no matching comparison results, then explanation has not carried out company used when attended operation The principal function of algorithm is connect, then needs to be implemented above-mentioned steps S120 to step S160 etc., to utilize the method for various embodiments of the present invention It is attached inquiry operation.
In this little embodiment, by disposably taking out all tuple datas of attribute to be compared in appearance and Nei Biao, then use One unified function is compared processing to these tuple datas, disposably returns to all tuple sequences for meeting condition of contact Number, the expense of acquisition plan nodal information and the expense of function call can be saved, to improve the efficiency of attended operation.Separately Outside, by simplifying data-interface form, software and hardware speeding scheme can be docked to accelerate function to calculate, so that connection be accelerated to grasp Make, improves execution efficiency.
In some specific embodiments, in order to optimize the query execution process of attended operation in existing DBMS.It is suitable for needing Sequence scanning pulls the case where tuple data is compared calculating and leads to inefficiency, is improved based on existing scheme, can With the optimization of the processes such as connection, left connection, right connection, anti-connection in supporting, accelerate.In those embodiments, a kind of needle is provided To the speeding scheme of database attended operation, it may include following steps S1 to S9.
S1, judges whether concrete condition needs to optimize acceleration.Specifically, when left and right two executive plan nodes not There are when the mode of line index scanning, S2 can be entered step and execute improved connection procedure, former connection procedure otherwise can be performed.
S2 judges whether that step S3 then can be performed if executing for the first time in the principal function for executing join algorithm for the first time, It is no to then follow the steps S9.
S3 parses the category respectively to be returned in appearance and Nei Biao from the relevant structural body of current executive plan node Property information and appearance and Nei Biao in respectively participate in connection attribute information.
S4 cyclically pulls tuple slot from left plan children tree nodes.Specifically, to even according to obtained in step S3 The information for connecing attribute takes out all tuple datas that participate in the attribute of connection, as subsequent from each tuple slot The input of kernel function;All tuple datas for taking out the attribute to be returned in these tuples slot simultaneously, can be stored in In dblib_outer_output_datums table, finished until all tuple slot in appearance are pulled, then execute step S5。
S5 is similar to step S4, and circulation pulls tuple slot from right plan children tree nodes.Specifically, according in step To the information of connection attribute obtained in S3, all number of tuples that participate in the attribute of connection are taken out from each tuple slot According to input as subsequent kernel function;All tuple datas of the attribute to be returned in these tuples slot are taken out simultaneously, It is stored in dblib_inner_output_datums table, is finished until tuple slot all in interior table are pulled, then execute Step S6.
S6 will participate in all members of the attribute of connection for what is respectively obtained in step S4 and step S5 in appearance and Nei Biao Group data, are successively compared one by one according to condition of contact, record the tuple for meeting connection request to serial number, be stored in In dblib_output_qual_index table, as the foundation being attached to two tables.Alternatively, this comparison procedure can be with A kernel function interface is assembled, for docking software and hardware speeding scheme, to meter conducted in this kernel function Calculation process carries out acceleration processing, to further speed up entire attended operation process.
S7 generates one suitable for the result slot structure for returning to database output.
S8 carries out corresponding position to serial number to the tuple of the successful match returned in step S6 according to different connection types Reason.If it is left connection or right connection, all items in appearance are returned.For those because it fails to match may be not present in Appearance tuple serial number in dblib_output_qual_index table, is rejoined dblib_output_qual_ In index table, its corresponding interior list cell group serial number -1 of juxtaposition, representative is not present and the interior tabular value of this successful match, after The value of corresponding position is returned as sky when continuous pulling data.If it is anti-connection, it is returned only to that there is no the outer of the corresponding matching value of interior table List cell group.So dblib_output_qual_index table is updated, may be not present for storing those because it fails to match Appearance tuple serial number in former dblib_output_qual_index table, juxtaposition its corresponding interior list cell group serial number can for- 1。
S9, it is to be returned obtained in the step S4 and step S5 according to newest dblib_output_qual_index table The data line for meeting condition of contact and connection type requirement is taken out in data.If corresponding data sequence number is -1, illustrate not deposit In analog value, can be returned with empty slot;Otherwise the more specific location information according to these data in result slot, uses this A little data carry out assignment to result slot, disposably return to a result slot, are recorded in dblib_output_ until all Data in qual_index table are all returned.
It should be noted that the improvement of this little embodiment is suitable for the operation of a variety of connection types, including interior connection, Zuo Lian It connects, right connection, anti-connection etc..The comparison of two attribute, the return of a variety of attributes can be supported in connection at present.It can support to connect The case where when node is leaf node, it can also support the attended operation of non-leaf nodes.
In this little embodiment, when doing data preparation early period, the corresponding tuple data of attribute is not extracted really, and It is the location information for first recording association attributes in physical holding of the stock structure, according to location information, property extracts lot number again According to carrying out unified comparison calculation processing, return again to qualified tuple serial number information.Wherein unified comparison calculation processing Process can dock software or hardware approach is further speeded up.Such as using multi -CPU (central processing unit) multithreading or It is the mode of single CPU parallel computation, while handles the comparison procedure of multipair tuple.Other than saving the expense of access evidence, The data that participation is compared also are only all tuple datas of some attribute, rather than the data of entire slot.Data mode becomes letter Singly make more convenient with docking for software and hardware speeding scheme.It should be noted that because hardware can only be handled directly simply Data type, so when the hardware such as incoming FPGA (programmable gate array) carry out accelerating to calculate, it is also necessary to the number being related to According to thaumatropy at structures such as relatively simple char type arrays.To sum up, this little embodiment is looked by optimizing existing DBMS The execution function logics in execution stage are ask, are proposed without additional line index nonproductive poll, can be added with outside with one The interface function of fast numerical procedure docking, to replace comparison procedure when being attached operation in original DBMS kernel, Neng Goujin One step improves the execution efficiency of database attended operation, has important meaning to increasingly huge database processing demand.
To make those skilled in the art be best understood from the present invention, it will illustrate implementation of the invention with specific embodiment below Mode.
By taking postgreSQL as an example, the optimization method proposed is done in conjunction with attached drawing and attended operation example further detailed It describes in detail bright.Specific example described herein is to carry out interior connection to two simple table student and sc in postgreSQL Operation.The attribute of table student has name and sno, and the attribute of table sc has sno and cno.Implement the attended operation of two tables, it is interior Condition of contact is sno equal.The attribute to be returned is the cno in name and table sc in table student.Below with reference to the accompanying drawings To illustrate this specific embodiment.
Fig. 2 is the process signal of the Connection inquiring method of the Relational DBMS of a specific embodiment of the invention Figure, Fig. 3 are critical datas involved in NestJoinLoop algorithm in PostgreSQL kernel in an of the invention specific embodiment The schematic diagram of structure NestLoopState, referring to figs. 2 and 3, the detailed process of the docking speeding scheme based on function include with Lower process:
(1) it is first determined whether situation can be accelerated by meeting.Specifically, all due to the sno of the sno of table student and table sc It is not major key, so, line index is not present, so handling using follow-up process.
(2) execution of attended operation is realized in PostgreSQL using NestJoinLoop (nesting recycles) algorithm Journey, therefore can determine whether the principal function for executing NestJoinLoop algorithm for the first time, if so, sequence executes next step Suddenly.
It (3) (is a pointer, it is directed toward a List structural body, this structural body contains from structural body joinqual The length of the leading address of one chained list, tail address and chained list) in parsing obtain participating in the attribute of connection in appearance student For sno, the location index in appearance is 0;The attribute that connection is participated in interior table sc is sno, and the location index in interior table is 1;Condition of contact be equal to.
(4) from the attribute student.name that parsing obtains being returned in structural body ps_ProjInfo in result slot Position be 1, position in appearance slot is 1, and position of the attribute sc.cno to be returned in result slot is 0, inside Position in table slot is 0.Further, since PostgreSQL is to be with some property location when pulling data from tables of data Benchmark can pull the data of the position and all properties less than the position.So may be used also when parsing ps_ProjInfo This benchmark is decided, determines that the principle of base position can be and takes maximum value in all execution steps, to guarantee subsequent number According to integrality.
(5) circulation pulls tuple slot from left plan children tree nodes outerPlan, takes out and wants from each tuple slot All tuple datas for participating in the attribute of connection, are stored in dblib_input_outer table, as kernel function later Input.All tuple datas for participating in the attribute returned in these tuples slot are further taken out, dblib_outer_ is stored in In output_datums table.It is finished until all tuples in appearance are all pulled.
(6) circulation pulls tuple slot from right plan children tree nodes innerPlan, takes out and wants from each tuple slot All tuple datas for participating in the attribute of connection, are stored in dblib_input_inner table, as kernel function later Input.All tuple datas for participating in the attribute returned in these tuples slot are further taken out, dblib_inner_ is stored in In output_datums table.It is finished until all tuples in interior table are all pulled.
(7) batch obtained above step data to be compared uniformly carry out calculation processing with a kernel function.In During this, can docking software acceleration, perhaps hardware-accelerated mode such as FPGA accelerates or multithreading etc., to this The process being uniformly processed is accelerated.Specifically, can be while more multiple by the way of multithreading or parallel computation Tuple pair, judges whether they meet condition of contact, and then their tuple serial number is recorded for the condition successful match of satisfaction In dblib_output_qual_index table.The detailed implementation of kernel function is as shown in Figure 4.Because this example describes Be interior connection, all relatively after, return corresponding tuple pair serial number record dblib_output_qual_ Index does not carry out other processing to the record.If it is other kinds of connection, it is also necessary to according to different types pair Dblib_output_qual_index table carries out different update processing.For example, if it is left connection, regardless of whether matching at Function needs to return data all in appearance, therefore to supplement in dblib_output_qual_index since it fails to match Without the appearance tuple serial number being recorded, corresponding interior list cell group serial number note can be -1, when facilitating subsequent returned data It can recognize that desirable without corresponding data herein, the empty tuple of return.If it is anti-connection, need to update dblib_output_ Qual_index is all appearance tuple serial numbers that it fails to match, and corresponding interior list cell group serial number note can also be -1.
(8) after completing the rescan operation to left and right plan children tree nodes, present node is projected, to obtain one A suitable structure dblib_result_tupleslot for returning to final result and being exported.
(9) it according to the serial number information in dblib_output_qual_index table, takes out in output_datums table and accords with The data to be returned of conjunction condition, return to dblib_result_tupleslot and are exported.It is primary only to return to one tupleslot.Since this example is interior connection, so only returning to the data of the successful match shared in two tables.It is other kinds of Connection procedure has different return the result.
In the embodiment, by disposably taking out all tuple datas of attribute to be compared in appearance and Nei Biao, then with one A unified kernel function is compared processing to these tuple datas, disposably returns to all tuples for meeting condition of contact Serial number.The expense for saving the expense and function call that obtain plan nodal information is docked soft or hard by simplifying data-interface form Part speeding scheme accelerates function to calculate, to accelerate attended operation, improves execution efficiency.
Based on inventive concept identical with the Connection inquiring method of Relational DBMS shown in FIG. 1, this hair Bright embodiment additionally provides a kind of connection query system of Relational DBMS, as described in following example.Due to The company of principle and Relational DBMS that the connection query system of the Relational DBMS solves the problems, such as Connect that querying method is similar, therefore the implementation of the connection query system of the Relational DBMS may refer to relationship type number According to the implementation of the Connection inquiring method of base management system, overlaps will not be repeated.
Fig. 5 is the structural schematic diagram of the Connection inquiring device of the Relational DBMS of one embodiment of the invention. As shown in figure 5, the Connection inquiring device of the Relational DBMS of some embodiments, it may include:
Nodal information acquiring unit 210, the left plan for obtaining Relational DBMS execute the letter of node Breath and right plan execute the information of node, wherein it includes the attribute to be returned in appearance that the left plan, which executes the information of node, With the attribute for participating in connection, the information that the right plan executes node includes the attribute to be returned in interior table and the category for participating in connection Property;
Location information acquiring unit 220, for respectively from the left dependency structure body for planning to execute node and the right side Plan executes in the dependency structure body of node, parses the location information for participating in the attribute of connection in the appearance and to be returned The location information of the attribute of connection and the location information for the attribute to be returned are participated in the location information of attribute and the interior table;
Left plan children tree nodes data pull unit 230, for the position according to the attribute for participating in connection in the appearance The location information of information and the attribute to be returned executes the children tree nodes in node from the left plan and pulls in the appearance All tuple datas of the attribute of connection and all tuple datas for the attribute to be returned are participated in all tuple slot, and are divided It is not stored in the first table and the second table;
Right plan children tree nodes data pull unit 240, for the position according to the attribute for participating in connection in the interior table The location information of information and the attribute to be returned executes the children tree nodes in node from the right plan and pulls in the interior table All tuple datas of the attribute of connection and all tuple datas for the attribute to be returned are participated in all tuple slot, and are divided It is not stored in third table and the 4th table;
Attended operation unit 250, for being matched using unified function according to the condition of contact of the appearance and the interior table Compare the tuple data in the tuple data and the third table in first table, and matching comparison result is stored in the 5th In table;
As a result output unit 260, for according to the 5th table, scheduled connection type, second table and described the Four tables return to Connection inquiring result.
In some embodiments, the Connection inquiring device of Relational DBMS shown in fig. 5, may also include that Applicable elements judging unit, for determining that the left plan executes node and the right plan executes node and line index is not present Scanning mode.Wherein, which is connected to nodal information acquiring unit 210 and location information acquiring unit Between 220.
In some embodiments, attended operation unit 250, it may include: attended operation module, being used for will be in first table Tuple data and the third table in tuple data be input to kernel function, according to the appearance and the interior table Condition of contact matches the tuple data in the tuple data and the third table in first table one by one, is met The tuple data of the condition of contact to index information, is stored in the 5th table corresponding tuple as matching comparison result.
In some embodiments, attended operation module, it may include: kernel function interface generation module is used for basis The condition of contact of the appearance and the interior table matches the member in tuple data and the third table in first table The set of procedures of group data is at kernel function interface, to utilize external software or the progress of hardware-accelerated execution kernel function With comparing, the tuple data for obtaining meeting the condition of contact is to corresponding tuple to index information.
In some embodiments, as a result output unit 260, it may include: Connection inquiring result output module is used for: in institute In the case where connection type is stated as interior connection, meet the tuple data of the condition of contact to corresponding according in the 5th table Tuple obtains corresponding tuple data to index information, from second table and the 4th table, and returns to the number of tuples of acquisition According to;In the case where the connection type is left connection, right connection or anti-connection, supplement does not meet described in the 5th table Condition of contact is to the information of the appearance tuple that it fails to match, and matching is arranged in the position of list cell group information in corresponding store Failure identifies, to update the 5th table, then according to updated 5th table, from second table and the 4th table The tuple data for needing to return is obtained, is returned with generating Connection inquiring result.
In some embodiments, Connection inquiring result output module, it may include: Connection inquiring result-generation module is used for: In the case where the connection type is left connection or right connection, according to updated 5th table, obtained from second table All tuple datas are taken, correspondingly, is obtained from the 4th table and meets the tuple data of the condition of contact, and are described the There is no the attribute of the tuple of successful match to be returned to return to null value in two tables, generates Connection inquiring result and returned;Institute Stating connection type is, according to updated 5th table, not meet from second table acquisition described in the case where instead connecting Condition of contact generates Connection inquiring result and is returned to the appearance tuple data that it fails to match.
In some embodiments, the Connection inquiring device of Relational DBMS shown in fig. 5, may also include that Attended operation executive condition judging unit, for determining that there is no in the tuple data and the third table in first table Tuple data matching comparison result.Wherein, attended operation executive condition judging unit can be with location information acquiring unit 220 Connection.
In some embodiments, the Connection inquiring device of Relational DBMS shown in fig. 5, may also include that Line index scan matching unit, for determining that the left plan executes node and/or the right plan executes node and there is row In the case where indexing scanning mode, the information of node is executed according to left plan and the right information for planning to execute node carries out line index Scanning, obtains Connection inquiring result.Line index scan matching unit can be connect with location information acquiring unit 220.
The embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, the journey The step of above-described embodiment the method is realized when sequence is executed by processor.
In conclusion the Connection inquiring method of the Relational DBMS of the embodiment of the present invention, relational data The Connection inquiring device and computer readable storage medium of base management system, it is to be compared in appearance and Nei Biao by disposably taking out All tuple datas of attribute, then processing is compared to these tuple datas with a unified function, disposably return to institute There is the tuple serial number for meeting condition of contact, the expense of acquisition plan nodal information and the expense of function call can be saved, thus Improve the execution efficiency of attended operation.
In the description of this specification, reference term " one embodiment ", " specific embodiment ", " some implementations Example ", " such as ", the description of " example ", " specific example " or " some examples " etc. mean it is described in conjunction with this embodiment or example Particular features, structures, materials, or characteristics are included at least one embodiment or example of the invention.In the present specification, Schematic expression of the above terms may not refer to the same embodiment or example.Moreover, the specific features of description, knot Structure, material or feature can be combined in any suitable manner in any one or more of the embodiments or examples.Each embodiment Involved in the step of sequence be used to schematically illustrate implementation of the invention, sequence of steps therein is not construed as limiting, can be as needed It appropriately adjusts.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Particular embodiments described above has carried out further in detail the purpose of the present invention, technical scheme and beneficial effects Describe in detail it is bright, it should be understood that the above is only a specific embodiment of the present invention, the guarantor being not intended to limit the present invention Range is protected, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should be included in this Within the protection scope of invention.

Claims (10)

1. a kind of Connection inquiring method of Relational DBMS characterized by comprising
The left plan for obtaining Relational DBMS executes the information of node and the information of right plan execution node, In, the information that the left plan executes node includes the attribute to be returned in appearance and the attribute for participating in connection, the right plan The information for executing node includes the attribute to be returned in interior table and the attribute for participating in connection;
Respectively from the dependency structure body that the left plan executes the dependency structure body of node and the right plan executes node, solution It is precipitated in the location information of attribute and the location information for the attribute to be returned and the interior table for participating in connection in the appearance and joins With the location information of the attribute of connection and the location information for the attribute to be returned;
According to the location information for the attribute for participating in connection in the appearance and the location information for the attribute to be returned, from the left meter The children tree nodes drawn in execution node pull all members that the attribute of connection is participated in all tuple slot in the appearance All tuple datas of group data and the attribute to be returned, and it is respectively stored in the first table and the second table;
According to the location information for the attribute for participating in connection in the interior table and the location information for the attribute to be returned, from the right meter The children tree nodes drawn in execution node pull all members that the attribute of connection is participated in all tuple slot in the interior table All tuple datas of group data and the attribute to be returned, and it is respectively stored in third table and the 4th table;
Using unified function according to the number of tuples in the condition of contact of the appearance and interior table matching first table According to the tuple data in the third table, and by matching comparison result be stored in the 5th table;
Connection inquiring result is returned according to the 5th table, scheduled connection type, second table and the 4th table.
2. the Connection inquiring method of Relational DBMS as described in claim 1, which is characterized in that respectively from institute It states left plan to execute in the dependency structure body of node and the dependency structure body of the right plan execution node, parses the appearance The attribute of connection is participated in the middle location information of attribute and the location information for the attribute to be returned and the interior table for participating in connection Location information and the attribute to be returned location information before, the method also includes:
Determine that the left plan executes node and the right plan executes node and line index scanning mode is not present.
3. the Connection inquiring method of Relational DBMS as described in claim 1, using unified function according to institute State the tuple in the tuple data and the third table in condition of contact matching first table of appearance and the interior table Data, and matching comparison result is stored in the 5th table, comprising:
Tuple data in tuple data and the third table in first table is input to kernel function, according to institute The condition of contact for stating appearance and the interior table is matched one by one in the tuple data and the third table in first table Tuple data, the tuple data for obtaining meeting the condition of contact, to index information, compare knot as matching to corresponding tuple Fruit is stored in the 5th table.
4. the Connection inquiring method of Relational DBMS as claimed in claim 3, by the member in first table Tuple data in group data and the third table is input to kernel function, according to the connection of the appearance and the interior table Condition matches the tuple data in the tuple data and the third table in first table one by one, obtains meeting described The tuple data of condition of contact is to corresponding tuple to index information, comprising:
By the tuple data matched according to the condition of contact of the appearance and the interior table in first table and described the The set of procedures of tuple data in three tables is at kernel function interface, to utilize external software or hardware-accelerated execution kernel Function carries out matching comparison, and the tuple data for obtaining meeting the condition of contact is to corresponding tuple to index information.
5. the Connection inquiring method of Relational DBMS as claimed in claim 3 according to the 5th table, makes a reservation for Connection type, second table and the 4th table return to Connection inquiring result, comprising:
In the case where the connection type is interior connection, according to the tuple data for meeting the condition of contact in the 5th table To corresponding tuple to index information, corresponding tuple data is obtained from second table and the 4th table, and return to acquisition Tuple data;
In the case where the connection type is left connection, right connection or anti-connection, supplement does not meet institute in the 5th table Condition of contact is stated to the information for the appearance tuple that it fails to match, and in the corresponding position setting for storing interior list cell group information With unsuccessfully identifying, to update the 5th table, then according to updated 5th table, from second table and the described 4th Table obtains the tuple data for needing to return, and is returned with generating Connection inquiring result.
6. the Connection inquiring method of Relational DBMS as claimed in claim 5, according to updated described Five tables obtain the tuple data for needing to return from second table and the 4th table, are returned with generating Connection inquiring result It returns, comprising:
In the case where the connection type is left connection or right connection, according to updated 5th table, from described second Table obtains all tuple datas, correspondingly, the tuple data for meeting the condition of contact is obtained from the 4th table, and be institute Stating does not have the attribute of the tuple of successful match to be returned to return to null value in the second table, generate Connection inquiring result and returned;
In the case where the connection type is anti-connection, according to updated 5th table, obtained not from second table Meet the condition of contact to the appearance tuple data that it fails to match, generates Connection inquiring result and returned.
7. the Connection inquiring method of Relational DBMS as described in claim 1, which is characterized in that respectively from institute It states left plan to execute in the dependency structure body of node and the dependency structure body of the right plan execution node, parses the appearance The attribute of connection is participated in the middle location information of attribute and the location information for the attribute to be returned and the interior table for participating in connection Location information and the attribute to be returned location information before, the method also includes:
Determine that there is no the matching comparison results of the tuple data in the tuple data and the third table in first table.
8. the Connection inquiring method of Relational DBMS as claimed in claim 2 is held from the left plan respectively The dependency structure body of row node and the right plan execute in the dependency structure body of node, parse and participate in connection in the appearance The location information of attribute and the location information for the attribute to be returned and the interior table in participate in connection attribute location information And before the location information for the attribute to be returned, the method also includes:
Determining the case where left plan executing node and/or the right plan execution node there are line index scanning modes Under, the information of node and the information progress line index scanning of right plan execution node are executed according to left plan, obtain Connection inquiring As a result.
9. a kind of Connection inquiring device of Relational DBMS characterized by comprising
Nodal information acquiring unit, by obtain Relational DBMS left plan execute node information and it is right based on Draw the information for executing node, wherein the information that the left plan executes node includes the attribute to be returned in appearance and the company of participation The attribute connect, the information that the right plan executes node include the attribute to be returned in interior table and the attribute for participating in connection;
Location information acquiring unit, for being executed respectively from the dependency structure body of the left plan execution node and the right plan In the dependency structure body of node, the position of location information and the attribute to be returned that the attribute of connection is participated in the appearance is parsed The location information of the attribute of connection and the location information for the attribute to be returned are participated in confidence breath and the interior table;
Left plan children tree nodes data pull unit, for according to participated in the appearance connection attribute location information and want The location information of the attribute of return executes the children tree nodes in node from the left plan and pulls all tuples in the appearance All tuple datas of the attribute of connection and all tuple datas for the attribute to be returned are participated in slot, and are respectively stored in First table and the second table;
Right plan children tree nodes data pull unit, for according to participated in the interior table connection attribute location information and want The location information of the attribute of return executes the children tree nodes in node from the right plan and pulls all tuples in the interior table All tuple datas of the attribute of connection and all tuple datas for the attribute to be returned are participated in slot, and are respectively stored in Third table and the 4th table;
Attended operation unit, it is relatively more described for being matched using unified function according to the condition of contact of the appearance and the interior table The tuple data in tuple data and the third table in first table, and matching comparison result is stored in the 5th table;
As a result output unit, for being returned according to the 5th table, scheduled connection type, second table and the 4th table Return Connection inquiring result.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor It is realized when execution such as the step of any one of claim 1 to 8 the method.
CN201910742186.0A 2019-08-13 2019-08-13 Connection query method and device for relational database management system Active CN110413651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910742186.0A CN110413651B (en) 2019-08-13 2019-08-13 Connection query method and device for relational database management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910742186.0A CN110413651B (en) 2019-08-13 2019-08-13 Connection query method and device for relational database management system

Publications (2)

Publication Number Publication Date
CN110413651A true CN110413651A (en) 2019-11-05
CN110413651B CN110413651B (en) 2020-12-08

Family

ID=68367082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910742186.0A Active CN110413651B (en) 2019-08-13 2019-08-13 Connection query method and device for relational database management system

Country Status (1)

Country Link
CN (1) CN110413651B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080183663A1 (en) * 2007-01-31 2008-07-31 Paul Reuben Day Dynamic Index Selection for Database Queries
CN106294499A (en) * 2015-06-09 2017-01-04 阿里巴巴集团控股有限公司 A kind of database data querying method and equipment
CN106874422A (en) * 2017-01-25 2017-06-20 东南大学 A kind of figure querying method of facing relation type database
CN110427437A (en) * 2019-07-31 2019-11-08 南京邮电大学 A kind of relevant database mixing isomery interrogation model and method towards big data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080183663A1 (en) * 2007-01-31 2008-07-31 Paul Reuben Day Dynamic Index Selection for Database Queries
CN106294499A (en) * 2015-06-09 2017-01-04 阿里巴巴集团控股有限公司 A kind of database data querying method and equipment
CN106874422A (en) * 2017-01-25 2017-06-20 东南大学 A kind of figure querying method of facing relation type database
CN110427437A (en) * 2019-07-31 2019-11-08 南京邮电大学 A kind of relevant database mixing isomery interrogation model and method towards big data

Also Published As

Publication number Publication date
CN110413651B (en) 2020-12-08

Similar Documents

Publication Publication Date Title
CN105824957B (en) The query engine system and querying method of distributed memory columnar database
US20170255673A1 (en) Batch Data Query Method and Apparatus
US20070250517A1 (en) Method and Apparatus for Autonomically Maintaining Latent Auxiliary Database Structures for Use in Executing Database Queries
CN112513836B (en) Structured record retrieval method, computing system and computer readable medium
CN110110108B (en) Data importing method and device of graph database
CN109871470B (en) Power grid equipment data labeling management system and implementation method
US20210026818A1 (en) System for Automated Data Engineering for Large Scale Machine Learning
CN106227799B (en) A kind of sql sentence processing method based on distributed data base
US20220004547A1 (en) Method, apparatus, system, device, and storage medium for answering knowledge questions
CN110175202A (en) The method and system of the outer connection of table for database
CN111475511A (en) Data storage method, data access method, data storage device, data access device and data access equipment based on tree structure
CN112000845B (en) Hyperspatial hash indexing method based on GPU acceleration
US9069837B2 (en) Encapsulation of multiplicity and sparsity in multidimensional query execution systems
CN108874873B (en) Data query method, device, storage medium and processor
US20210286817A1 (en) System and method for disjunctive joins using a lookup table
CN110413651A (en) The Connection inquiring method and device of Relational DBMS
US20230205769A1 (en) System and method for disjunctive joins
Hasan et al. An approach for data transformation in homogeneous and heterogeneous information systems
CN113468169A (en) Hardware database query method, database system query method and device
CN107784032A (en) Gradual output intent, the apparatus and system of a kind of data query result
CN109992630B (en) Data model matching method and device
CN109241098B (en) Query optimization method for distributed database
CN113468178A (en) Data partition loading method and device of association table
CN110297842A (en) A kind of data comparison method, device, terminal and storage medium
JP2015082293A (en) Information processing apparatus, information processing method, and program

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
GR01 Patent grant
GR01 Patent grant