CN103218439B - A kind of empty attribute query optimization method of object-oriented proxy database - Google Patents

A kind of empty attribute query optimization method of object-oriented proxy database Download PDF

Info

Publication number
CN103218439B
CN103218439B CN201310139781.8A CN201310139781A CN103218439B CN 103218439 B CN103218439 B CN 103218439B CN 201310139781 A CN201310139781 A CN 201310139781A CN 103218439 B CN103218439 B CN 103218439B
Authority
CN
China
Prior art keywords
class
source
proxy
cost
proxy class
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.)
Active
Application number
CN201310139781.8A
Other languages
Chinese (zh)
Other versions
CN103218439A (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.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
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 Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN201310139781.8A priority Critical patent/CN103218439B/en
Publication of CN103218439A publication Critical patent/CN103218439A/en
Application granted granted Critical
Publication of CN103218439B publication Critical patent/CN103218439B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses the empty attribute query optimization method of a kind of object-oriented proxy database, method proposes the prioritization scheme promoted based on expression formula. In the prioritization scheme promoted based on expression formula, according to the characteristic that proxy class is unique, in the source class corresponding to different proxy class, inquiry has carried out cost estimation, it is proposed that cost estimation function. The cost that well source class and proxy class can be scanned by cost estimation function is weighed, thus judging whether to carry out expression formula lifting. After satisfying condition, adopting and be similar to the processing mode of view, by the inquiry of proxy class is promoted to the inquiry to source class, thus reducing the calculation times of switching expression formula, reaching the purpose optimized. By the inquiry of empty attribute is optimized, it is possible to be greatly enhanced the practicality of object broker data base.

Description

A kind of empty attribute query optimization method of object-oriented proxy database
Technical field
The present invention relates to data base querying process field, especially relate to the empty attribute query optimization method of a kind of object-oriented proxy database.
Background technology
Along with the development of information technology, database technology also improves constantly. Because of its complete theory and effectively realize method with the traditional database that relevant database is representative, achieve significant progress and extensively effective application. New field is GIS-Geographic Information System, knowledge base system and multimedia information system etc. such as, data base proposes new demand, it is desirable to be able to efficiently process complex data type. Database technology combine with object-oriented method be database technology research and application important directions, occur in that object oriented programming model therewith, introduce the key concept such as object and object identity. In OODBS, data base is object set, and object is made up of data and method.
OODBS supports unconventional data type preferably, but is a lack of common model and formalized description, and Maturity is not enough technically, is difficult with and promotes in reality. As the expansion of object oriented programming model, object deputy model derives from procuratorial concept in life. In object deputy model, mainly one agent object of structure is as its view in the process of object information, and agent object can inherit the part or all of attribute of source object, is called empty attribute, can also extend new attribute simultaneously, be called real attribute.The all objects sharing same attribute and method constitute an object class, and all agent objects constitute proxy class. In actual storage, only store the value of real attribute, empty attribute memory module information, not its value of actual storage, but obtained the value of corresponding real attribute by pointer.
According to the object broker data base that object deputy model realizes, because of the memory mechanism that it is special, adopting the mode of switching expression formula, the empty attribute of storage associates with real attribute, by this evaluation of expression obtains the value of empty attribute in real time. Performing the stage at object broker data base querying, the acquisition of empty attribute significantly impacts the efficiency of inquiry, optimizes the search efficiency of empty attribute and promotes the use of great meaning for object broker data base.
Summary of the invention
The above-mentioned technical problem of the present invention is addressed mainly by following technical proposals:
The empty attribute query optimization method of a kind of object-oriented proxy database, it is characterised in that based on defined below: in object broker data base, proxy class is similar to special view, but the view of not identity relation type data base; Proxy class can inherit attribute and the method for source class, simultaneously expansible corresponding attribute again; When the inquiry processed in proxy class, it is possible to use for reference the method that relevant database processes view, rise in the class of source by the query expression in proxy class, this process is referred to as expression formula and promotes; When creating proxy class, it is necessary to agent rule part extracted, agent rule is identical with the form creating view, adopts the mode of system creation view, is registered in system by proxy class with the form of view; Described expression formula promotes and comprises the following steps:
Step 1, sets up proxy class list DeputyList, the range table list that scan for inquiries relates to, it is judged that whether current class is proxy class, if current class is proxy class, and is not related to such real attribute in queries, then joins in DeputyList; If current class is not proxy class, then without carrying out expression formula lifting, terminate whole step;
Step 2, for each proxy class in the DeputyList that generates in step 1, if cost that its inquiry needs is cost1, set Query Cost in source class corresponding after proxy class promotes as cost2 simultaneously, if cost1 > cost2, then this proxy class of labelling is for promoting; If cost1��cost2, then the cost after promoting expression formula is not less than the cost not promoted, and this proxy class of labelling is not for promoting;
Step 3, for being labeled as the proxy class that can promote in DeputyList, adopts the mode of query rewrite, and the place that this proxy class is occurred is written over, and carrys out rewritten query by source class and agent rule, promotes thus realizing expression formula;
Step 4, after query expression is promoted to source class, if this source class is proxy class, goes to step 2. If this source class is not proxy class, then terminate whole process.
At the empty attribute query optimization method of above-mentioned a kind of object-oriented proxy database, in described step 2, in step 2, cost calculating process is as follows:
Object deputy model passes through object broker algebra definition proxy class; Object broker algebraically is mainly made up of six kinds of basic operations of SELECT, PROJECT, EXTEND, UNION, JOIN, GROUP, combination according to these six kinds of basic operations, object broker data base defines proxy class type four kinds basic, respectively SELECT, UNION, JOIN, GROUP tetra-kinds, due in object broker data base, index scanning has particularity, and in order to same traditional database combines, spy introduces the cost under sequential scan;
Step 2.1, proxy class, when storage, have employed storage real attribute value, and empty attribute only stores source object and the strategy of agent object bidirectional pointer. When scanning proxy class, it is impossible to directly obtain the value of empty attribute. The cost obtaining empty property value is divided into scanning proxy class, searches source object and agent object bidirectional pointer table (pg_bipointer) and obtains source object three part according to source object object identity, and it is expressed as shown in formula one:
PCost=N (D)+MAPCost+PF (S) formula one
Wherein, defining N (D) disk number shared by proxy class D, MAPCost is the cost of scanning pg_bipointer table, and PF (S) is the cost obtaining source object.
Step 2.2, in SELECT proxy class, after the inquiry in proxy class is risen to source class, the cost that scanning relates to is mainly the cost of scanning source table, and it is expressed as shown in formula two:
FCost1=N (S) formula two
Wherein, definition N (S) disk number shared by the class S of source.
Step 2.3, in UNION proxy class, after the inquiry in proxy class is risen to source class, the UNION operation of two subqueries during scanning, have to be realized, therefore the cost after promoting is mainly two subqueries and the cost of UNION operation, and it is expressed as shown in formula three:
FCost2=N (S1)+N (S2)+P (S1)+P (S2) formula three
Wherein, disk number shared by definition N (S1)=source class S1, N (S2) is disk number shared by the class S2 of source, and P (S1) is source class S1 number of tuples, and P (S2) is source class S2 number of tuples.
Step 2.4, in JOIN proxy class, after the inquiry in proxy class is risen to source class, have to realize the JOIN operation of class, and JOIN operation is operation very consuming time in data base, when there is this proxy class, does not generally carry out lifting operation during scanning. It carries out the cost formula after expression formula lifting such as shown in formula four:
FCost3=N (S1)+N (S2)+P (S1) * P (S2) formula four
Wherein, disk number shared by definition N (S1)=source class S1, N (S2) is disk number shared by the class S2 of source, and P (S1) is source class S1 number of tuples, and P (S2) is source class S2 number of tuples.
Step 2.5, in GROUP proxy class, after the inquiry in proxy class is risen to source class, needs to carry out aggregation operator during inquiry, but regardless of whether promote, is required for carrying out aggregation operator during inquiry. When therefore carrying out cost calculating after promoting expression formula, the main cost considering that the scanning to source class and source class press the packet of certain attribute, its cost formula is such as shown in formula five:
FCost4=N (S)+V (S1) formula five
Wherein, defining N (S) disk number shared by the class S of source, V (S1) is the source class S cost by the packet of certain attribute.
Step 2.6, compares PCost and FCost, if PCost is relatively larger, then carries out promoting expression formula operation.
Therefore; present invention have the advantage that 1. for the inquiry effect of having greatly improved of proxy class; it is described as follows: for feature and the situation of different proxy class; adopt the mode that cost is estimated; cost calculating is carried out respectively before and after expression formula is promoted; the proxy class satisfied condition is selected to promote, thus ensureing that expression formula promotes the efficiency to inquiry and has castering action; 2. system is realized there is very big directive function; it is described as follows: for the feature of proxy class; during definition agent rule; adopt the processing mode of view in traditional database; in lifting process; proxy class is carried out query rewrite, and the inquiry for proxy class provides a more efficient mode; 3. time complexity is low, and the search efficiency of object broker data base is had bigger raising, and the popularization for object broker data base has great meaning.
Accompanying drawing explanation
Fig. 1 is proxy class form of Definition.
Fig. 2 is the agent rule form of SELECT proxy class.
Fig. 3 is the method flow schematic diagram of the present invention.
Detailed description of the invention
By the examples below, and in conjunction with accompanying drawing, technical scheme is described in further detail.
Embodiment:
The present invention is to provide the search efficiency improving empty attribute based on the mode promoting expression formula, specifically adopt the method comprised the following steps:
In object broker data base, proxy class is similar to special view, but the view of not identity relation type data base. Proxy class can the attribute of derived class and method, simultaneously expansible corresponding attribute again. When the inquiry processed in proxy class, it is possible to use for reference the method that relevant database processes view, rise in the class of source by the query expression in proxy class, this process is referred to as expression formula and promotes. When creating proxy class, proxy class form of Definition is as shown in Figure 1, need to extract agent rule part, for SELECT proxy class, as shown in Figure 2, agent rule is identical with the form creating view, adopts the mode of system creation view, proxy class is registered in system with the form of view.
The step promoting expression formula includes following sub-step:
Step 1, sets up proxy class list DeputyList, the range table list that scan for inquiries relates to, it is judged that whether current class is proxy class, if current class is proxy class, and is not related to such real attribute in queries, then joins in DeputyList. If current class is not proxy class, then without carrying out expression formula lifting.
Step 2, for each proxy class in DeputyList, the cost cost1 that inquiry needs, directly converts proxy class and inquires about in the class of source, and the cost cost2 that inquiry needs, if cost1 > cost2, then this proxy class of labelling is for promoting. If cost1��cost2, then the cost after promoting expression formula is not less than the cost not promoted, and this proxy class of labelling is not for promoting.
Step 3, for being labeled as the proxy class that can promote in DeputyList, adopts the mode of query rewrite, and the place that this proxy class is occurred is written over, and carrys out rewritten query by source class and agent rule, promotes thus realizing expression formula.
Step 4, after query expression is promoted to source class, if this source class is proxy class, goes to step 2. If this source class is not proxy class, then terminate whole process.
Cost estimating part in step 2 is described in detail with a concrete example:
SELECT proxy class is only to allow to select source object to act on behalf of from an apoplexy due to endogenous wind. Source object and agent object are one to one. With an instantiation, boosting algorithm is illustrated.
CREATECLASSbasicA (aint, bint, cint); A has index
CREATESELECTDEPUTYCLASSdeputyB(dint)as(selecta+2asnewa,bfrombasicAwherea>3andb>4);
Query statement: SELECTnewa, bFROMdeputyBWHEREnewa < 10;
In the query compiler stage, object table comprises proxy class deputyB. Carry out now cost estimation, it may be judged whether need to carry out expression formula lifting.
The cost directly deputyB being scanned: scanning pattern is divided into sequential scan and tape index scanning, and cost is cost1 respectively, cost2, selects scanning pattern cost3=min(cost1, cost2 that cost is less). Owing to comprising empty attribute in alternative condition, therefore switching over expression formula and calculate, cost comprises the inquiry to system table and the I/O operation for the treatment of excess syndrome attribute, is designated as cost4.Wherein, the CPU cost of expression solution symbol is less is negligible. When objective attribute target attribute row comprise empty attribute, similar with the processing procedure comprising empty attribute in alternative condition, cost is cost5. Total cost sumcost1=cost3+cost4+cost5.
Being converted into the basicA cost being scanned: have index on a, it is possible to can select the scanning of tape index, it is also possible to the path of selecting sequence scanning, cost is cost6 and cost7 respectively, and scanning cost is cost8=min(cost6, cost7). When conditional judgment and project, owing to the value of tuple is real attribute, it is in esse, relates only to CPU cost. Total cost sumcost2=cost8.
Query rewrite part in step 3 is described in detail with a concrete example:
As sumcost1 < sumcost2, expression formula is risen in the class of source, uses for reference the process that view query is rewritten by PostgreSQL data base, be converted into:
Original query tree after the explanation of analyzed device, representation in logic:
SELECTdeputyB.newa,deputyB.bFROMdeputyBWHEREdeputyB.newa<10;
Query tree after expression formula lifting, representation in logic:
SELECTdeputyB.newa,deputyB.bFROM(SELECTa+2asnewa,bFROMbasicAwherea>3andb>4)deputyBWHEREdeputyB.newa<10;
Inquiry on deputyB is converted into the inquiry to basicA.
Its excess-three kind proxy class situation is similar with SELECT proxy class situation, it is possible to reference to the processing mode of SELECT.
Specific embodiment described herein is only to present invention spirit explanation for example. Described specific embodiment can be made various amendment or supplements or adopt similar mode to substitute by those skilled in the art, but without departing from the spirit of the present invention or surmount the scope that appended claims is defined.

Claims (2)

1. the empty attribute query optimization method of an object-oriented proxy database, it is characterised in that based on defined below: in object broker data base, proxy class is similar to special view, but the view of not identity relation type data base; Proxy class can inherit attribute and the method for source class, simultaneously expansible corresponding attribute again; When the inquiry processed in proxy class, it is possible to use for reference the method that relevant database processes view, rise in the class of source by the query expression in proxy class, this process is referred to as expression formula and promotes; When creating proxy class, it is necessary to agent rule part extracted, agent rule is identical with the form creating view, adopts the mode of system creation view, is registered in system by proxy class with the form of view; Described expression formula promotes and comprises the following steps:
Step 1, sets up proxy class list DeputyList, the range table list that scan for inquiries relates to, it is judged that whether current class is proxy class, if current class is proxy class, and is not related to such real attribute in queries, then joins in DeputyList; If current class is not proxy class, then without carrying out expression formula lifting, terminate whole step;
Step 2, for each proxy class in the DeputyList that generates in step 1, if cost that its inquiry needs is cost1, set Query Cost in source class corresponding after proxy class promotes as cost2 simultaneously, if cost1 > cost2, then this proxy class of labelling is for promoting; If cost1��cost2, then the cost after promoting expression formula is not less than the cost not promoted, and this proxy class of labelling is not for promoting;
Step 3, for being labeled as the proxy class that can promote in DeputyList, adopts the mode of query rewrite, and the place that this proxy class is occurred is written over, and carrys out rewritten query by source class and agent rule, promotes thus realizing expression formula;
Step 4, after query expression is promoted to source class, if this source class is proxy class, goes to step 2, if this source class is not proxy class, then terminates whole process.
2. the empty attribute query optimization method of a kind of object-oriented proxy database according to claim 1, it is characterised in that in described step 2, it is as follows that cost calculates process:
Object deputy model passes through object broker algebra definition proxy class; Object broker algebraically is mainly made up of six kinds of basic operations of SELECT, PROJECT, EXTEND, UNION, JOIN, GROUP, combination according to these six kinds of basic operations, object broker data base defines proxy class type four kinds basic, respectively SELECT, UNION, JOIN, GROUP tetra-kinds, due in object broker data base, index scanning has particularity, and in order to same traditional database combines, spy introduces the cost under sequential scan;
Step 2.1, proxy class is when storage, have employed storage real attribute value, empty attribute only stores source object and the strategy of agent object bidirectional pointer, when scanning proxy class, can not directly obtaining the value of empty attribute, the cost obtaining empty property value is divided into scanning proxy class, searches source object and agent object bidirectional pointer table and obtains source object three part according to source object object identity, and it is expressed as shown in formula one:
PCost=N (D)+MAPCost+PF (S) formula one
Wherein, defining N (D) disk number shared by proxy class D, MAPCost is the cost of scanning agent object bidirectional pointer table, and PF (S) is the cost obtaining source object; PCost is the cost of empty property value;
Step 2.2, in SELECT proxy class, after the inquiry in proxy class is risen to source class, the cost that scanning relates to is mainly the cost of scanning source table, and it is expressed as shown in formula two:
FCost1=N (S) formula two
Wherein, definition N (S) disk number shared by the class S of source;
Step 2.3, in UNION proxy class, after the inquiry in proxy class is risen to source class, the UNION operation of two subqueries during scanning, have to be realized, therefore the cost after promoting is mainly two subqueries and the cost of UNION operation, and it is expressed as shown in formula three:
FCost2=N (S1)+N (S2)+P (S1)+P (S2) formula three
Wherein, disk number shared by definition N (S1)=source class S1, N (S2) is disk number shared by the class S2 of source, and P (S1) is source class S1 number of tuples, and P (S2) is source class S2 number of tuples;
Step 2.4, in JOIN proxy class, after inquiry in proxy class is risen to source class, the JOIN operation of class have to be realized during scanning, and JOIN operation is operation very consuming time in data base, when there is this proxy class, generally not carrying out lifting operation, it carries out the cost formula after expression formula lifting such as shown in formula four:
FCost3=N (S1)+N (S2)+P (S1) * P (S2) formula four
Wherein, disk number shared by definition N (S1)=source class S1, N (S2) is disk number shared by the class S2 of source, and P (S1) is source class S1 number of tuples, and P (S2) is source class S2 number of tuples;
Step 2.5, in GROUP proxy class, after inquiry in proxy class is risen to source class, need during inquiry to carry out aggregation operator, but regardless of whether promote, it is required for during inquiry carrying out aggregation operator, when therefore carrying out cost calculating after promoting expression formula, the main cost considering that the scanning to source class and source class are grouped by certain attribute, its cost formula is such as shown in formula five:
FCost4=N (S)+V (S) formula five
Wherein, defining N (S) disk number shared by the class S of source, V (S) is the source class S cost by the packet of certain attribute;
Step 2.6, compares PCost and FCost, if PCost is relatively larger, then carries out promoting expression formula operation.
CN201310139781.8A 2013-04-22 2013-04-22 A kind of empty attribute query optimization method of object-oriented proxy database Active CN103218439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310139781.8A CN103218439B (en) 2013-04-22 2013-04-22 A kind of empty attribute query optimization method of object-oriented proxy database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310139781.8A CN103218439B (en) 2013-04-22 2013-04-22 A kind of empty attribute query optimization method of object-oriented proxy database

Publications (2)

Publication Number Publication Date
CN103218439A CN103218439A (en) 2013-07-24
CN103218439B true CN103218439B (en) 2016-06-08

Family

ID=48816226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310139781.8A Active CN103218439B (en) 2013-04-22 2013-04-22 A kind of empty attribute query optimization method of object-oriented proxy database

Country Status (1)

Country Link
CN (1) CN103218439B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107480199B (en) * 2017-07-17 2020-06-12 深圳先进技术研究院 Query reconstruction method, device, equipment and storage medium of database
CN110059108B (en) * 2019-04-28 2022-11-29 武汉大学 Optimization method for mobile-end-oriented object proxy database correlation query
CN110162642A (en) * 2019-05-21 2019-08-23 武汉大学 Patent knowledge map construction method based on object broker database
CN111797114B (en) * 2020-06-24 2021-08-31 武汉大学 Multi-path cross-class query and optimization method in object proxy database
CN112380192B (en) * 2020-12-03 2024-02-09 广州海量数据库技术有限公司 Method and system for realizing object-oriented framework in database

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216844A (en) * 2008-01-03 2008-07-09 彭智勇 Database cross-class inquiry method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8321443B2 (en) * 2010-09-07 2012-11-27 International Business Machines Corporation Proxying open database connectivity (ODBC) calls

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216844A (en) * 2008-01-03 2008-07-09 彭智勇 Database cross-class inquiry method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Realization of biological data management by object deputy database system;Zhiyong Peng et al;《Transactions on Computatianal Syatems Biology V》;20061231;第49-67页 *
一种支持对象代理数据库高效查询处理的索引结构;黄泽谦等;《计算机科学》;20100831;第33卷(第8期);第1446-1459页 *
对象代理数据库的查询处理与优化;张广舟等;《计算机科学》;20051231;第32卷(第7期);第97-100页 *

Also Published As

Publication number Publication date
CN103218439A (en) 2013-07-24

Similar Documents

Publication Publication Date Title
CN103218439B (en) A kind of empty attribute query optimization method of object-oriented proxy database
US10606834B2 (en) Methods and apparatus of shared expression evaluation across RDBMS and storage layer
AU2005239366B2 (en) Partial query caching
US8756237B2 (en) Scalable distributed processing of RDF data
CN105260403B (en) General integration across database access method
US20060230016A1 (en) Systems and methods for statistics over complex objects
US7814091B2 (en) Multi-tiered query processing techniques for minus and intersect operators
EP2885727B1 (en) Hardware implementation of the filter/project operations
CN104361113A (en) OLAP (On-Line Analytical Processing) query optimization method in memory and flesh memory hybrid storage mode
CN106446134B (en) Local multi-query optimization method based on predicate specification and cost estimation
CN105677683A (en) Batch data query method and device
CN114399227A (en) Production scheduling method and device based on digital twins and computer equipment
CN104462351A (en) Data query model and method for MapReduce pattern
CN104346384A (en) Method and device for processing small files
CN103793467A (en) Method for optimizing real-time query on big data on basis of hyper-graphs and dynamic programming
Kraft et al. Willump: A statistically-aware end-to-end optimizer for machine learning inference
Shanoda et al. JOMR: Multi-join optimizer technique to enhance map-reduce job
CN115237937A (en) Distributed collaborative query processing system based on interplanetary file system
CN106156171A (en) A kind of enquiring and optimizing method of Virtual asset data
CN105608077A (en) Big data distributed storage method and system
CN106844541A (en) A kind of on-line analytical processing method and device
CN109446293A (en) A kind of parallel higher-dimension nearest Neighbor
CN103198133A (en) Query optimization method for converting XPath (XML path language) query into tree-form data structure
Zhang et al. A method to optimize apriori algorithm for frequent items mining
US8832157B1 (en) System, method, and computer-readable medium that facilitates efficient processing of distinct counts on several columns in a parallel processing system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant