CN1808431A - Multi-table connecting method - Google Patents

Multi-table connecting method Download PDF

Info

Publication number
CN1808431A
CN1808431A CN 200510135913 CN200510135913A CN1808431A CN 1808431 A CN1808431 A CN 1808431A CN 200510135913 CN200510135913 CN 200510135913 CN 200510135913 A CN200510135913 A CN 200510135913A CN 1808431 A CN1808431 A CN 1808431A
Authority
CN
China
Prior art keywords
record
variable
effective start
start date
connecting method
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
CN 200510135913
Other languages
Chinese (zh)
Other versions
CN100576203C (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN200510135913A priority Critical patent/CN100576203C/en
Publication of CN1808431A publication Critical patent/CN1808431A/en
Application granted granted Critical
Publication of CN100576203C publication Critical patent/CN100576203C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

Disclosed is a plural table connection method for forming a third table by connecting a first table of plural records with a second table of plural records. Each record of first and second table is provided with valid start date, valid end date, first amount and/or second amount. The invention employs the precondition of combining according to time period; the result can be acquired by taking ergodic on two tables once. Therefore, two tables can be connected to one table by processing M+N records which resolves the loss of boundary values in SQL method.

Description

Multi-table connecting method
Technical field
The present invention relates to the multilist interconnection technique field in the data warehouse, particularly relate to a kind of multi-table connecting method, to improve the efficient that multilist connects according to Time Compression.
Background technology
An important feature of data warehouse is to store a large amount of historical datas.A kind of common situation is that many destination datas are identical, these records is stored will be caused storage space to waste greatly simply.A kind of commonly used improving one's methods is that these records are compressed storage according to the time period, represents the time validity that writes down by add effective Start Date (Effective_From) and effective Close Date (Effective_To) two fields in fact table and dimension table.Like this, identical recordings can record of boil down in a period of time, and this method can make full use of storage space.The father W.H.Inmon of data warehouse and data warehouse expert Ralph Kimball introduce this method in monograph separately.But this compression method commonly used has brought complicacy also for simultaneously the multilist attended operation, because traditional index and table connected mode all can not play a role fully.Therefore, how to realize fast and efficiently that this attended operation of the multilist of compression on a time period becomes a common problem.
In order more clearly to set forth this class problem, be described at three tables shown in Fig. 6 (A)~6 (C) below.At the table shown in Fig. 6 (A), for example T1 is common fact table, wherein the SK field is represented surrogate, the A field is represented a quantity (may be number of transaction or other quantity), effective Start Date, effectively the Close Date, wherein the date of a minimum of " 1900-01-01 " expression, " 9999-12-31 " represents the date of a maximum.Similarly, the table shown in Fig. 6 (B), for example T2, it is common dimension table, wherein the SK field is represented surrogate, and the B field is represented certain attribute information (may be credit card numbering or other information), and the implication of effective Start Date and effective Close Date two fields is with identical as mentioned above.Table T1 is connected the correct T3 of table as a result that the back generates with table T2 according to term of validity time period relation, shown in Fig. 6 (C).
For such multilist attended operation, the most original a kind of method is " decompress(ion) " record at first, soon a record of storing according to the time period becomes record per diem, quantity wherein is all identical, be the Time Compression record of May 1 for example to May 31 for a time period, per diem carry out to generate 31 records behind the decompress(ion), these records are all identical except all the other all fields of date field, then fact table and dimension table were merged according to SK and date, at last table is as a result compressed storage according to the time period again.The simplest this method is very low on efficient, and will expend many storage spaces and use for temporary table in the merging process of three steps.
Some other method is to adopt SQL statement to realize according to the different condition that the time period merges, in this respect, IBM, companies such as NCR have all provided the SQL statement mode of their suggestion, the above-mentioned original method of efficiency ratio improves a lot, and generally all adopts the mode of this SQL statement to solve this type of connectivity problem in data warehouse project.But this method that generally adopts at present still exists two main shortcomings.
1.SQL the execution efficient of statement mode is not high
Efficient for SQL statement is as follows from the theory of algorithm angle analysis:
Carry out the attended operation of two tables with SQL statement, its basis is based upon does cartesian product to two tables.If two tables have M respectively, N bar record then needs M * N bar record is handled, and algorithm complexity is O (M * N).
Can obtain following analytic process according to situation more generally:
The value of supposing different SK in the T1 table has the M kind, and the value of each SK has N respectively i(promptly i SK has N to the bar record iThe bar record, i=1,2,3 ... M).
The value of supposing different SK in the T2 table has the P kind, and the value of each SK has Q respectively i(promptly i SK has Q to the bar record iThe bar record, i=1,2,3 ... P).
Then the cartesian product of realizing for SQL has following analysis:
Condition of contact is T1.SK=T2.SK, and the table as a result that then connects back formation is total: The bar record, wherein s be N with Q in the number of identical SK.
But, if consider the factor of index, can further obtain following analytic process:
T1 table and T2 are shown field SK as condition of contact, EF, ET adds index respectively, SQL statement reads record in the T1 table at every turn in practical implementation like this, searches in the T2 table then, owing to adopted index, therefore needn't the whole table of sequential search, but on certain sort algorithm basis, search according to searching algorithm, according to the theory of algorithm proof as can be known, search the highest log of being of efficiency of algorithm 2 N, wherein N is the record strip number, through our the inquiry plan analysis to SQL statement in the oracle environment, the search efficiency to concordance list in the oracle environment is log 2 N
In order to analyze for purpose of brevity, suppose to have only a SK in the T1 table here, value has M bar record, a SK of same correspondence is arranged among the T2, and value has N bar record, can see, the mean value of M being regarded as different SK corresponding record numbers in the T1 table, regard N the mean value of different SK corresponding record numbers in the T2 table as, according to above-mentioned hypothesis, the number of times of SQL mode access list is: M * log 2 N+ M works as M, and when N was very big, such operation still needed to expend the long time.
What in addition, modern relational database management system (RDBMS:Relation DataBaseManagement System) connected that SQL statement mainly adopts for table is that development and the nested loop of coming connect (Nested Loop Join), ordering and merge and connect that (Sort Merge Join) and Hash connect (Hash Join) and based on the improvement algorithm of these methods on the cartesian product basis.
But, because the singularity that connects according to the time period that this type of problem exists makes these algorithms that generally adopt still can not play a role fully on this type of problem.In three kinds of table join algorithm that the real data base management system is adopted, the nested loop connected mode is the same with the cartesian product operation substantially, during actual employing that different is for the certain optimization of I/O operation having carried out of data, but the basic operation that table connects: record number relatively is constant.
Though ordering merge to connect for general table and connects the efficient that can reach O (M+N), its precondition is that the field value as condition of contact is just to reach this optimum efficient when unique and condition of contact is for equivalent the connection in the table.If the condition of contact field value is not unique or condition of contact is that non-equivalence connects, efficient will descend greatly so, and this is called the essential defective (Intrinsic Skew) that ordering merges join algorithm by the foreign study person.At these ordering join algorithm decrease in efficiency problems that causes owing to data problem, Many researchers is all studied, but the improvement algorithm that proposes mainly focuses on the read-write number of times that how to reduce database when relatively pointer need be recalled, also do not have a kind of algorithm can significantly reduce the record number of comparisons at present, make efficient get back to this optimum value of O (M+N).
The Hash join dependency is in selected hash function, also do not have at present a kind ofly can make various tables connect the hash function that situations can both reach optimum efficiency.In addition, the realization more complicated that Hash connects depends on concrete data base management system (DBMS) to a great extent.May not have Hash to connect for some light-dutyer data base management system (DBMS)s, the multilist connection just is difficult to be optimized so.
2.SQL statement can cause record to lose when handling for the boundary value situation
The SQL method can be lost a period of time for the processing of fact table and each SK article one record of Wei Biao, for example for the data shown in the table of Fig. 6 (A) and Fig. 6 (B), for the record of SK=1, article one record is shown in the table of Fig. 7 in the table as a result that the use SQL statement obtains.As can be seen from Figure 7, lost information during this period of time from 1999-01-01 to 1999-04-30, the information for article one among Fig. 6 (A) record of that is to say has caused loses, and lose be recorded in the data warehouse definitely unallowed.The SQL statement mode is in order to solve losing of this boundary value, must add extra statement and differentiate and handle.
Summary of the invention
The present invention has overcome deficiency of the prior art, provide a kind of form succinct, irrelevant with platform specific and programming language, the multilist connection by time compression storage in the field, data warehouse is had general applicability, carry out the multi-table connecting method that efficient improves tangible Time Compression.
In one aspect of the invention, having proposed a kind of first table that will have many records is connected to form the multi-table connecting method of the 3rd table with second table with many records, each bar record of described first table and second table all has effective Start Date separately, effective Close Date, first quantity and/or second quantity, described method comprises step: first step, initialization is used for keeping in first quantitative variation and second quantitative variation of first quantity and second quantity respectively, and is used for keeping in the record of first table and first record variable and second record variable of second record of showing respectively; Second step is read in first record variable and second record variable respectively with a record of first table and a record of second table; Third step, less effective Start Date is as effective Start Date of a record in the 3rd table in effective Start Date with the effective Start Date of first record variable and second record variable, and with first quantity in the record at less effective Start Date of place and second quantity one as one in first quantity of this record of the 3rd table and second quantity, with second quantity of the quantity in one of first quantitative variation and second quantitative variation as this record in the 3rd table; The 4th step, if effectively Start Date, little that had untreated record in showing in first table and second table, first quantity that then will show or second quantity are saved in first quantitative variation and second quantitative variation, and with next bar recording storage of next bar record of first table or second table to first record variable or second record variable, and keep in first record variable and second record variable that big record variable of effective start time constant; And the 5th step, if effectively do not have untreated record in little that table of start time in first table and second table, all records during then another that first table and second is shown shown are input to the 3rd table in proper order.
According to one embodiment of present invention, at described third step, if effective Start Date of this record equals effective Start Date of this record in second table in first table, effective Start Date of this record in then being shown as the 3rd any one effective Start Date of respective record in two tables, and first quantity and second quantity of this record of the 3rd table are got first quantity of the first current record variable and second quantity of second record variable.
According to one embodiment of present invention, at described third step, not article one, then with the previous day of effective Start Date of current output effective concluding time as last record in the 3rd table if output to the record of the 3rd table.
According to one embodiment of present invention, in described the 4th step, if effective start time of first record variable equals effective start time of second record variable, then preserve the first current quantity and second quantity to first quantitative variation and second quantitative variation, and from first table and second table, read next bar and record first record variable and second record variable, the execution third step.
According to one embodiment of present invention, described first table is a fact table, and described second table is the dimension table.
According to one embodiment of present invention, the record during described first table and second is shown sorts according to major key.
According to one embodiment of present invention, the record in described first table and second table is according to surrogate, effectively Start Date, effective Close Date ascending sort.
According to one embodiment of present invention, described first quantity is number of transaction, and described second quantity is the credit card numbering.
Utilize the solution of the present invention, the execution efficiency ratio SQL statement mode that table connects has very big raising, and can not cause losing of boundary value.
Description of drawings
Fig. 1 is the process flow diagram according to the multi-table connecting method of the embodiment of the invention;
Fig. 2 is the synoptic diagram of the tables of data used in the implementation according to the multi-table connecting method of the embodiment of the invention;
Fig. 3 shows the synoptic diagram of the abstract list structure that principle adopted that is used for illustrating method of the present invention;
Fig. 4 shows according to the execution efficient of multi-table connecting method of the present invention and the comparison between the prior art;
Fig. 5 shows according to the multi-table connecting method of the embodiment of the invention correction result to boundary value;
Fig. 6 (A), 6 (B) and 6 (C) show the fact table T1, the dimension table T2 that are used for illustrating prior art and table T3 as a result respectively;
Fig. 7 shows the table that is used for illustrating the problem that boundary value that the SQL method causes is lost.
Embodiment
The contrast accompanying drawing describes specific embodiments of the invention in detail below.
[principle]
Fig. 3 shows the synoptic diagram of the abstract list structure that principle adopted that is used for illustrating method of the present invention.List structure as shown in Figure 3 is that of the problems referred to above is abstract, can be generalized at an easy rate based on this list structure discussion in the concrete list structure of this type of problem.
In Fig. 3, table T1 and T2 represent two source tables of attended operation, table as a result after T3 represents to connect, SK represents that the agency is strong among the table T1, A represents certain numerical value, and EF represents effective Start Date, and ET represents effective Close Date, B represents certain numerical value among the table T2, other three field implications with show T1 in consistent.Here suppose table T1 and T2 all according to SK (surrogate), EF (effectively Start Date), ET (effectively Close Date) ascending sort finishes, and this prerequisite is easy to satisfy in practice.
Multi-table connecting method according to the embodiment of the invention utilizes this type of problem according to the characteristics of time period as condition of contact, only need just can obtain the result to two each run-down of table, that is to say that working as two table record numbers is respectively M, during N, only need to handle M+N bar record altogether.
The prerequisite that connects according to the time period is that two record key assignments are identical.But because two tables are orderly according to major key, if therefore two record key assignments are inequality, so directly output gets final product.For clear description method of the present invention, suppose that below two tables record SK to be compared is identical, compare according to the time period relation.In view of the data warehouse load mode of Time Compression, this precondition is one to fix on this type of and satisfy naturally in using, but so this suppose not influence the generalization and the follow-up analysis of this method for method efficient.
The principle of multi-table connecting method of the present invention is as described below.
First step, initializing variable PreA, the A that once exports before PreB preserves, B value.Initializing variable Tmp1, Tmp2 preserves T1, and T2 is when the record of pre-treatment.
Second step is read in T1, and two of T2 record Tmp1, Tmp2.
Third step, relatively the EF of Tmp1 and the EF of Tmp2 export less EF value as T3.EF, and the A of T3 or B get the variate-value (A or B) of less EF value institute corresponding record, and another variable is gone bail for and is deposited variable PreA or PreB.If T1.EF=T2.EF then exports any EF value as T3.EF, the A among the T3, B get current Tmp1, the A of Tmp2, B.If output is not article one record of T3, the EF that then gets current output subtracts 1 ET as last record among the T3.
The 4th step, the record if the source of less EF table is untreated is then preserved current A or B to PreA or PreB, reads in next bar and records Tmp1 or Tmp2, and pairing Tmp1 of bigger EF or Tmp2 remain unchanged.If the EF of Tmp1 equals the EF of Tmp2, then preserve current A, B is to PreA, PreB, two tables all read in next bar and are recorded to Tmp1 and Tmp2, get back to third step.
The 5th step, if be not untreated record in the source of the less EF table, then order exports that all record T3 in another table, another variable among the T3 is got PreA or PreB, finishes then.
[example]
To contrast accompanying drawing below, technical scheme of the present invention will be elaborated.Fig. 1 is the process flow diagram according to the multi-table connecting method of the embodiment of the invention.Fig. 2 is the synoptic diagram of the tables of data used in the implementation according to the multi-table connecting method of the embodiment of the invention.
Step 101: method begins.
Step 102: initializing variable PreA, PreB, Tmp1, Tmp2, wherein variable PreA is used to preserve the last A that handles, and PreB is used to preserve the last B that handles, and Tmp1 is used to preserve the record of T1 when pre-treatment, and Tmp2 is used to preserve the record of T2 when pre-treatment.
Step 103: the article one of reading in T1 records Tmp1, and article one of T2 records Tmp2.
Step 104: judge that whether Tmp1.EF is greater than Tmp2.EF.
Step 105: judged result is a "Yes" in step 104, and promptly during Tmp1.EF>Temp2.EF, Tmp2.EF is as T3.EF in output, and Tmp2.B is as T3.B, and PreA is as T3.A.If not T3 article one record, then export the ET of current Tmp2.EF-1 as the last record of T3, preserve Tmp2.B to PreB.
Step 106: judge whether the T2 table also has untreated record.
Step 107: judged result is a "Yes" in step 106, promptly also has untreated record among the T2, and next bar that then reads in T2 records Tmp2, keeps Tmp1 constant simultaneously, and goes to step 104.
Step 108: judged result is a "No" in step 106, does not promptly have untreated record among the T2, then exports the remaining T3 of recording among the T1, and as T3.EF, T1.A is as T3.A with T1.EF, and PreB goes to step 121 as T3.B, and method finishes.
Step 109: judged result is a "No" in step 104, promptly during Tmp1.EF<=Temp2.EF, judges that whether Tmp1.EF is less than Tmp2.EF.
Step 110: judged result is a "Yes" in step 109, when being Tmp1.EF<Tmp2.EF, Tmp1.EF is as T3.EF in output, Tmp1.A is as T3.A, PreB is as T3.B, if not T3 article one record, then export the ET of current Tmp1.EF-1 as the last record of T3, preserve Tmp1.A to PreA.
Step 111: judge whether the T1 table also has untreated record.
Step 112: judged result is a "Yes" in step 111, promptly also has untreated record among the T1, and next bar that then reads in T1 records Tmp1, keeps Tmp2 constant simultaneously, and goes to step 104.
Step 113: judged result is a "No" in step 111, does not promptly have untreated record among the T1, then exports the remaining T3 of recording among the T2, and as T3.EF, T2.B is as T3.B with T2.EF, and PreA is as T3.A, and goes to step 121, and method finishes.
Step 114: judged result is a "No" in step 109, when being Tmp1.EF=Tmp2.EF, Tmp1.EF is as T3.EF in output, Tmp1.A is as T3.A, Tmp2.B if not T3 article one record, then exports the ET of current Tmp1.EF-1 as the last record of T3 as T3.B, preserve Tmp1.A to PreA, preserve Tmp2.B to PreB.
Step 115: judge whether the T1 table has the record of handling or not.
Step 116: judged result is a "No" in step 115, does not promptly have untreated record among the T1, then exports the remaining T3 of recording among the T2, and as T3.EF, T2.B is as T3.B with T2.EF, and PreA goes to step 121 as T3.A, and method finishes.
Step 117: judged result is a "Yes" in step 115, promptly has the record of handling among the T1 or not, and next bar that then reads in T1 records Tmp1, keeps Tmp2 constant simultaneously.
Step 118: judge whether the T2 table has the record of handling or not.
Step 119: judged result is a "No" in step 118, does not promptly have untreated record among the T2, then exports the remaining T3 of recording among the T1, and as T3.EF, T1.A is as T3.A with T1.EF, and PreB goes to step 121 as T3.B, and method finishes.
Step 120: judged result is a "Yes" in step 118, promptly has the record of handling among the T2 or not, and next bar that then reads in T2 records Tmp2, keeps Tmp1 constant simultaneously.Go to step 104.
Step 121: method finishes.
For said method is described a understanding is more intuitively arranged, Fig. 2 is at table T1 and the given method implementation example of T2 data, because SK=1 is consistent with SK=2 record implementation, so has only provided the implementation status of the record of SK=1 among Fig. 2.Number in the figure 1 to 6 has shown each time the process to recording operation.The left side of Fig. 2 has shown the value situation of change of 4 variablees, and each output result has been represented on arrow the right.Therefore because the record of SK=1 respectively has three in the table 1, table 2, needed to carry out 6 steps altogether just can obtain final result.
[comparison]
By top description, the execution efficiency ratio SQL statement mode of multi-table connecting method of the present invention has very big raising (because the efficient of first kind of original decompression mode obviously less than the SQL statement height, does not therefore compare TCJ method and this method) as can be seen.
At first, method of the present invention has made full use of this precondition that two tables merged according to the time period, only needs once just can obtain the result to two table traversals.Therefore only need handle M+N bar record, the complicacy of the inventive method is O (M+N), compares with the SQL mode to have remarkable advantages.
With corresponding in the background technology part, can obtain following analytic process according to situation more generally for method of the present invention for the analysis of SQL method efficient.
Suppose that the value of different SK has the M kind in the fact table, the value of each SK has N respectively i(promptly i SK has N to the bar record iThe bar record, i=1,2,3 ... M).
The value of supposing different SK in the dimension table has the P kind, and the value of each SK has Q respectively i(promptly i SK has Q to the bar record iThe bar record, i=1,2,3 ... P).
Like this, the back table as a result that forms of method connection of the present invention is total: The bar record, wherein s be N with Q in the number of identical SK.
Then the TCJ method with the ratio of the efficient of SQL method is
Figure A20051013591300132
In order to simplify following formula, get N ', Q ' represents N respectively i, Q iMean value, then following formula can be reduced to S ( N ′ × Q ′ ) S ( N ′ + Q ′ ) = N ′ × Q ′ N ′ + Q ′ , And fact table N ' value is much larger than dimension table Q ' value generally speaking, and then following formula can further be reduced to N ′ × Q ′ N ′ = Q ′ .
And if consider the factor of index, the analysis from the background technology part can see that the number of times of SQL way access table is about
Figure A20051013591300135
And the number of times of the inventive method access list is: M+N, the ratio of both efficient is
Figure A20051013591300136
When N=1, log 2 NGetting minimum value is 0, and then the ratio of efficient is M>>1 generally speaking, then both efficiency value ratios approximate 1, illustrate that when having only a record under each SK in the dimension table, two kinds of method efficient equate.If have M>>N, then following formula can be reduced to M × log 2 N + M M = M ( log 2 N + 1 ) M = log 2 N + 1 , Illustrate that after having adopted index to be optimized, the efficient of SQL mode increases, but method of the present invention still can improve log than SQL mode 2 N+ 1 times.
Experiment has adopted SAS V8.2 to realize method of the present invention, at Intel P42.8GHZ, 512MB RAM, move in the Windows 2000Professional environment, compare with the SQL statement mode, SQL statement adopts is that simple and high-efficient that all SQL implementations are obtained after by analysis is a kind of:
select
a.sk,
a.A,
b.B,
max(a.ef,b.ef,&MIN_DATE)as?ef,
min(a.et,b.et,&MAX_DATE)as?et
from?t1?as?a
left?join?t2?as?b
on(a.sk=b.sk)and
(a.ef<=b.et?and?a.et>=b.ef);
Experimental result tables of data as shown in Figure 4.Can see that from the table of Fig. 4 the execution speed of method of the present invention has improved 3 times to 45 times than SQL statement, the record number that the multiple of raising is corresponding with each SK in the dimension table is proportional.
In addition, use result that the SQL statement mode obtains can cause and lose, and method of the present invention can obtain correct result at article one record of each SK.For example for table T1 shown in Fig. 6 (A) and Fig. 6 (B) and the data among the T2, for the record of SK=1, article one record as shown in Figure 7 in the table as a result that the use SQL statement obtains.On the contrary, use correct result that method of the present invention obtains as shown in Figure 5.Therefore, method of the present invention can be eliminated the boundary value that the SQL method causes fully and loses problem.
The above; only be the embodiment among the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with the people of this technology in the disclosed technical scope of the present invention; the conversion that can expect easily or replacement all should be encompassed in of the present invention comprising within the scope.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claims.

Claims (8)

1, a kind of first table that will have many records is connected to form the multi-table connecting method of the 3rd table with second table with many records, each bar record of described first table and second table all has effective Start Date separately, effective Close Date, first quantity and/or second quantity, and described method comprises step:
First step, initialization are used for keeping in first quantitative variation and second quantitative variation of first quantity and second quantity respectively, and are used for keeping in the record of first table and first record variable and second record variable of second record of showing respectively;
Second step is read in first record variable and second record variable respectively with a record of first table and a record of second table;
Third step, less effective Start Date is as effective Start Date of a record in the 3rd table in effective Start Date with the effective Start Date of first record variable and second record variable, and with first quantity in the record at less effective Start Date of place and second quantity one as one in first quantity of this record of the 3rd table and second quantity, with second quantity of the quantity in one of first quantitative variation and second quantitative variation as this record in the 3rd table;
The 4th step, if effectively Start Date, little that had untreated record in showing in first table and second table, first quantity that then will show or second quantity are saved in first quantitative variation and second quantitative variation, and with next bar recording storage of next bar record of first table or second table to first record variable or second record variable, and keep in first record variable and second record variable that big record variable of effective start time constant; And
The 5th step, if effectively do not have untreated record in little that table of start time in first table and second table, all records during then another that first table and second is shown shown are input to the 3rd table in proper order.
2, multi-table connecting method as claimed in claim 1, it is characterized in that, at described third step, if effective Start Date of this record equals effective Start Date of this record in second table in first table, effective Start Date of this record in then being shown as the 3rd any one effective Start Date of respective record in two tables, and first quantity and second quantity of this record of the 3rd table are got first quantity of the first current record variable and second quantity of second record variable.
3, multi-table connecting method as claimed in claim 1, it is characterized in that, at described third step, not article one if output to the record of the 3rd table, then with the previous day of effective Start Date of current output effective concluding time as last record in the 3rd table.
4, multi-table connecting method as claimed in claim 1, it is characterized in that, in described the 4th step, if effective start time of first record variable equals effective start time of second record variable, then preserve the first current quantity and second quantity to first quantitative variation and second quantitative variation, and from first table and second table, read next bar and record first record variable and second record variable, the execution third step.
As the described multi-table connecting method of one of claim 2~4, it is characterized in that 5, described first table is a fact table, described second table is the dimension table.
6, multi-table connecting method as claimed in claim 5 is characterized in that, the record in described first table and second table sorts according to major key.
7, multi-table connecting method as claimed in claim 5 is characterized in that, the record in described first table and second table is according to surrogate, effective Start Date, effective Close Date ascending sort.
8, multi-table connecting method as claimed in claim 5 is characterized in that, described first quantity is number of transaction, and described second quantity is the credit card numbering.
CN200510135913A 2005-12-31 2005-12-31 Multi-table connecting method Active CN100576203C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200510135913A CN100576203C (en) 2005-12-31 2005-12-31 Multi-table connecting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200510135913A CN100576203C (en) 2005-12-31 2005-12-31 Multi-table connecting method

Publications (2)

Publication Number Publication Date
CN1808431A true CN1808431A (en) 2006-07-26
CN100576203C CN100576203C (en) 2009-12-30

Family

ID=36840330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200510135913A Active CN100576203C (en) 2005-12-31 2005-12-31 Multi-table connecting method

Country Status (1)

Country Link
CN (1) CN100576203C (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100464334C (en) * 2007-06-06 2009-02-25 中国工商银行股份有限公司 Data incremental backup and recovery method applied to data bank
CN101311931B (en) * 2007-05-21 2011-12-07 Sap股份公司 Compression of tables based on occurrence of values
CN103198132A (en) * 2013-04-12 2013-07-10 中国农业银行股份有限公司 Method and device for data processing
CN104391864A (en) * 2014-10-24 2015-03-04 浪潮软件股份有限公司 Unstructured data storage method convenient for information obtaining in one step
CN105468740A (en) * 2015-11-24 2016-04-06 网易(杭州)网络有限公司 Game player data storage and analysis method and apparatus
CN106126670A (en) * 2016-06-28 2016-11-16 努比亚技术有限公司 Operation data sequence processing method and processing device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101311931B (en) * 2007-05-21 2011-12-07 Sap股份公司 Compression of tables based on occurrence of values
CN100464334C (en) * 2007-06-06 2009-02-25 中国工商银行股份有限公司 Data incremental backup and recovery method applied to data bank
CN103198132A (en) * 2013-04-12 2013-07-10 中国农业银行股份有限公司 Method and device for data processing
CN104391864A (en) * 2014-10-24 2015-03-04 浪潮软件股份有限公司 Unstructured data storage method convenient for information obtaining in one step
CN105468740A (en) * 2015-11-24 2016-04-06 网易(杭州)网络有限公司 Game player data storage and analysis method and apparatus
CN105468740B (en) * 2015-11-24 2019-03-08 网易(杭州)网络有限公司 A kind of storage, analysis method and the device of game player's data
CN106126670A (en) * 2016-06-28 2016-11-16 努比亚技术有限公司 Operation data sequence processing method and processing device

Also Published As

Publication number Publication date
CN100576203C (en) 2009-12-30

Similar Documents

Publication Publication Date Title
US8037059B2 (en) Implementing aggregation combination using aggregate depth lists and cube aggregation conversion to rollup aggregation for optimizing query processing
CN1808431A (en) Multi-table connecting method
Mamoulis et al. Efficient top-k aggregation of ranked inputs
US8838593B2 (en) Method and system for storing, organizing and processing data in a relational database
CN1249614C (en) Unit design device and method
US20060230017A1 (en) Using query expression signatures in view matching
CN102402615B (en) Method for tracking source information based on structured query language (SQL) sentences
CN101079033A (en) Integrative searching result sequencing system and method
US8583655B2 (en) Using an inverted index to produce an answer to a query
CN1492361A (en) Processing method for embedded data bank searching
CN1858737A (en) Method and system for data searching
CN104285222A (en) Optimizing queries using predicate mappers
Kandula et al. Pushing data-induced predicates through joins in big-data clusters
Katsifodimos et al. Materialized view selection for XQuery workloads
CN107798346A (en) Quick track similarity matching method based on Frechet distance threshold
CN1645402A (en) Road traffic flow data quality controlling method and apparatus
CN1848162A (en) Method, system and program for evaluating reliability on component
Jiang et al. Good to the last bit: Data-driven encoding with codecdb
Athanassoulis et al. Design tradeoffs of data access methods
Yu et al. Two birds, one stone: a fast, yet lightweight, indexing scheme for modern database systems
Grust et al. Tree awareness for relational DBMS kernels: Staircase join
CN101064018A (en) HSEncoding computer automatically enquiring system
Yang et al. Traverse: simplified indexing on large map-reduce-merge clusters
Vogel et al. Automatic blocking key selection for duplicate detection based on unigram combinations
Pavlovic et al. Dictionary compression in point cloud data management

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