CN100403314C - Data inquiry method - Google Patents

Data inquiry method Download PDF

Info

Publication number
CN100403314C
CN100403314C CNB2006100766143A CN200610076614A CN100403314C CN 100403314 C CN100403314 C CN 100403314C CN B2006100766143 A CNB2006100766143 A CN B2006100766143A CN 200610076614 A CN200610076614 A CN 200610076614A CN 100403314 C CN100403314 C CN 100403314C
Authority
CN
China
Prior art keywords
data
inquiry
execution
index
data table
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
CNB2006100766143A
Other languages
Chinese (zh)
Other versions
CN1967529A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006100766143A priority Critical patent/CN100403314C/en
Publication of CN1967529A publication Critical patent/CN1967529A/en
Application granted granted Critical
Publication of CN100403314C publication Critical patent/CN100403314C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

A data query method includes the following steps: step 1, separating the database data into discrete data and continuous data, and respectively stored in discrete data sheet and continuous data sheet; step 2, determining the inquiries sequence of the said discrete data sheet and continuous data sheet; step 3, finally, processing data inquiries according to the inquiries sequence. The said data query method separates the data in the database into discrete data and continuous data, and respectively stores them in discrete data sheet and continuous data sheet; and determines the inquiries sequence of the said discrete data sheet and continuous data sheet through artificial means or automatic statistical analysis methods; and then data inquiries. The invention is simple, easy to use, and high versatility, and greatly enhances the efficiency of data inquiries, particularly suited for application systems with enormous data scale and high using frequency, and has extensive practicality.

Description

A kind of data enquire method
Technical field
The present invention relates to a kind of data enquire method, especially a kind ofly can improve efficiency data query, and highly versatile, be simple and easy to the data enquire method of usefulness.
Background technology
In the operation analysis system of telecom operators and production system, all need to carry out the lot of data query manipulation for support applications.The principal feature of operation analysis system is that data volume is huge, inquiry complexity height, and search efficiency is directly connected to the analysis result whether operator can in time obtain needs, thereby instructs the adjustment of management tactics.The characteristics of production system are that a large number of users rolls off the production line on frequent and the online user measures hugely, and the efficient of data query directly has influence on user's the experience and the portfolio of operator.For above-mentioned reasons, operation analysis system and production system are all high to the response time requirement of inquiry.
By analysis to a large number of services, we find the related data of overwhelming majority inquiry, may also may disperse continuously, almost there is not rule, and it is huge usually, the relative total amount that can be buffered in the internal memory of application system is considerably less, and the inquiry of the overwhelming majority remains directly to be finished by database.
In existing data enquire method, generally for application system handle easy, all the data with same type according to fixed format all are stored in same the table of database.Generally can (form such as 1396666xxxx~1396667xxxx) provides primary data with the telephone number section such as telecom operators, the table that is used for storing these data so needs two row (Column) at least, one row sign initial number, one row sign finishes number, also can two list and set up index accordingly at this, promptly carry out index range scanning (Index Range Scan) by search data by the index value scope, thereby realize inquiry database.But the data of quite a few can be decomposed again in the practical business running, form the less number segment data of a large amount of one number data and interval span, just so-called each self-separation of wherein a large amount of one number data, discontinuous " discrete data ".The increase of discrete data can cause showing the data scale expansion, data are regular reduces, thereby has caused the reduction of search efficiency, therefore is difficult to adapt to the huge characteristics of telecommunication service data volume.
Summary of the invention
The objective of the invention is provides a kind of data enquire method at above-mentioned the deficiencies in the prior art, and this method can improve efficiency data query, and highly versatile, is simple and easy to use.
For achieving the above object, the invention provides a kind of data enquire method, may further comprise the steps:
Step 1: is the data separating in the database discrete data and continuous data, and leaves in respectively in discrete data table and the continuous data table; Wherein, step 1 specifically comprises:
Step 11, extract a record in the described database, if extracts successfully then execution in step 12 gets nowhere then end if extract;
Whether step 12, the index initial data of judging described record and index end data equate; If equate then should write down the described discrete data table of insertion; If it is unequal then should write down and insert described continuous data table;
Step 13, judging whether the record in the described database has extracted, is execution in step 2 then, otherwise execution in step 11;
Step 2: the search order of determining described discrete data table and described continuous data table;
Step 3: carry out data query according to described search order.
In the technique scheme, described step 3 can specifically comprise: if described search order is for looking into the discrete data table earlier, then carry out following steps: in step 31, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, if successful inquiring then finish, the execution in step 32 if inquiry is unsuccessful; Then in step 32, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data.If described search order is for looking into the continuous data table earlier, then carry out following steps: step 31 ' in, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, if successful inquiring then finish, the execution in step 32 if inquiry is unsuccessful '; Then step 32 ' in, described discrete data table is carried out the unique index inquiry with the row of identification index initial data.
Wherein, in the described discrete data table, not having the data of repetition in the row of identification index initial data, also is that the index initial data and the index end data of every record in the described discrete data table equates, therefore can set up unique index.And in the described continuous data table, there are the data that repeat in the row of identification index initial data, the index initial data and the index end data that also are every record are unequal, therefore can set up composite index according to the row of sign index initial data and the row of sign index end data.As shown in Table 1 and Table 2, after the data submeter was preserved, the data regularity in two tables had all obtained reinforcement.
The row name Explanation
The index initial data Set up unique index
Other fields 1
Other fields 2
......
Other fields n
Table 1 discrete data table
The row name Explanation
The index initial data Set up composite index according to index initial data and index end data
The index end data Set up composite index according to index initial data and index end data
Other fields 1
Other fields 2
......
Other fields n
Table 2 continuous data table
In the technique scheme, in data query, the discrete data table makes the unique scanning of index of reference, need not to use the index range scanning of poor efficiency; The continuous data table then continues to use index range scanning, but uses a table to preserve the way of all data relatively, and the data scale has here descended, and search efficiency has obtained effective control.
Because we have been distributed to data in two tables, need inquire about according to certain strategy during actual queries, receive that promptly needing after the specific query requests decision which looks into earlier opens table, need be in two tables under the worst case respectively inquiry once just can obtain the data that need.Evenly or near evenly distributing (the discrete data table is pressed the record strip number and is calculated in two tables but when data, the continuous data table calculates according to ∑ (index end data-index initial data+1)) time, regardless of search order, inquiry 50% chance all arranged as long as once can obtain the result, that is to say as long as original half the data of retrieval just can find the result, can greatly improve search efficiency.Even just obtain for twice in inquiry under result's the situation, because discrete data can be used the unique inquiry of index efficiently, though continuous data is used index range scanning, but data scale has reduced, total search efficiency still can near in addition be higher than all data be kept at a method in the table, as near and the degree that is higher than then depend on the search order of distribution situation, data scale and the setting of discrete data and continuous data.
Further, in technique scheme, can also determine described search order by statistical analysis technique, be specially: between described step 2 and step 3, also can may further comprise the steps: in step 21, record statistical study project and current search order, and set statistics start time and statistics concluding time; In step 22, the inquiry total degree that writes down is added one.Described step 3 can specifically may further comprise the steps: in step 300, whether judging described search order for looking into the discrete data table earlier, is execution in step 310 then, otherwise execution in step 310 '; In step 310, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, and judge whether success of inquiry, if successful inquiring then execution in step 311, the execution in step 320 if inquiry is unsuccessful; In step 311, the number of times that the one query of record is hit adds one, finishes then; In step 320, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, and judge whether success of inquiry, if successful inquiring then execution in step 321 finish if inquiry is unsuccessful; In step 321, the number of times of secondary query hit of record is added one, finish then; Step 310 ' in, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, and judge whether success of inquiry, if successful inquiring then execution in step 311 ', the execution in step 320 if inquiry is unsuccessful '; Step 311 ' in, the number of times that hits of one query of record is added one, finish then; Step 320 ' in, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, and judges whether success of inquiry, finish if inquiry is unsuccessful, if successful inquiring then execution in step 321 '; Step 321 ' in, the number of times of secondary query hit of record is added one, finish then.Also can may further comprise the steps after the described step 3: in step 4, judging whether to arrive the described statistics concluding time, is execution in step 6 then, otherwise execution in step 5; In step 5, judge whether new query requests, be execution in step 22 then, otherwise continue execution in step 5; In step 6,, determine described search order then according to one query hit-count, secondary query hit number of times and the inquiry total degree of record.Described step 6 can specifically may further comprise the steps: in step 61, calculate according to following formula and once to hit success ratio and secondary hits success ratio:
Once hit success ratio=one query hit-count/inquiry total degree;
Secondary hits success ratio=secondary query hit number of times/inquiry total degree;
In step 62, whether the more described success ratio of once hitting hits success ratio greater than described secondary then, is execution in step 63 then, otherwise execution in step 64; In step 63, determine that described search order is search order last time, finish then; In step 64, in the exchange last time search order after the order of discrete data table and continuous data table as described search order, finish then.
In technique scheme, determine search order by the automatic statistical analysis method, use statistical method to analyze success ratio first current search order under, and with this as judging whether rational foundation of current search order.Described automatic statistical analysis method can regularly start a plurality of statistics tasks, at first will give the fixed initial search order of each task and a statistics concluding time, and all there are default value search order and statistics concluding time, can certainly artificially revise.Start and do not need manual intervention between the statistics concluding time in automatic statistical analysis, by Query Result is added up, the data of hitting several times, inquiring about such as inquiry still find in the continuous data table at the discrete data table, can determine whether current search order is reasonable.Final analysis conclusion (being search order) can be used as configuration information record to file or database, as next search order.
In sum, the present invention is by after becoming discrete data and continuous data to the data separating in the database, inquire about respectively, thereby realize category submeter storage data, reduce index range scanning, increase the unique scanning of index, further, by automatic statistical analysis to Query Result, determine best search order, thereby reached following useful technique effect: the efficient that has improved data query greatly, because the scale of data is very big in the application system, frequency of utilization is very high, answers the performance of this entire system also to be greatly improved; Highly versatile can satisfy most demands in the reality; Be simple and easy to use.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Description of drawings
Fig. 1 is the synoptic diagram of the specific embodiment of the invention one;
Fig. 2 is the synoptic diagram of the specific embodiment of the invention two;
Fig. 3 is the synoptic diagram of the specific embodiment of the invention three;
Fig. 4 is the synoptic diagram of the specific embodiment of the invention four;
Fig. 5 is the synoptic diagram of the specific embodiment of the invention five.
Embodiment
Referring to the synoptic diagram of specific embodiment shown in Figure 1, a kind of data enquire method may further comprise the steps: in step 1, be the data separating in the database discrete data and continuous data, and leave in respectively in discrete data table and the continuous data table; In step 2, determine the search order of described discrete data table and described continuous data table then; In step 3, carry out data query at last according to described search order.Present embodiment is inquired about respectively by after the data separating in the database is become discrete data and continuous data, thereby has improved the efficient of data query, and highly versatile, is simple and easy to use.
Referring to the synoptic diagram of specific embodiment shown in Figure 2 two, a kind of data enquire method is with the difference of specific embodiment one: also be included in the query script image data and carry out automatic statistical analysis, to determine the higher search order of one query hit rate.
Referring to the synoptic diagram of specific embodiment shown in Figure 3 three, a kind of data enquire method may further comprise the steps: in step 11, extract a record in the described database, if extract successfully then execution in step 12, if extract unsuccessful then finish; In step 12, judge whether the index initial data of described record and index end data equate, if equate then should write down the described discrete data table of insertion, if unequal then should write down the described continuous data table of insertion; In step 13, judge whether the record in the described database has extracted, be execution in step 2 then, otherwise execution in step 11; In step 2, determine the search order of described discrete data table and described continuous data table then; In step 3, carry out data query at last according to described search order.
Referring to the synoptic diagram of specific embodiment shown in Figure 4 four, a kind of data enquire method may further comprise the steps: in step 1, be the data separating in the database discrete data and continuous data, and leave in respectively in discrete data table and the continuous data table; In step 2, determine the search order of described discrete data table and described continuous data table then; In step 30, whether judging described search order for looking into the discrete data table earlier then, is execution in step 31 then, otherwise execution in step 31 '; In step 31, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, if successful inquiring then finish execution in step 32 if inquiry is unsuccessful; In step 32, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, finish then; Step 31 ' in, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, if successful inquiring then finish, the execution in step 32 if inquiry is unsuccessful '; Step 32 ' in, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, finish then.In this specific embodiment, after the data separating in the database is become discrete data and continuous data, inquire about respectively, thereby realize category submeter storage data, reduce index range scanning, increase the unique scanning of index, and then improved the efficient of data query, and highly versatile, be simple and easy to use.
Referring to the synoptic diagram of specific embodiment shown in Figure 5 five, a kind of data enquire method may further comprise the steps: in step 1, be the data separating in the database discrete data and continuous data, and leave in respectively in discrete data table and the continuous data table; In step 2, determine the search order of described discrete data table and described continuous data table then; Then in step 21, write down statistical study project and current search order, and set statistics start time and statistics concluding time; In step 22, the inquiry total degree that writes down is added one; In step 300, whether judge described search order for looking into the discrete data table earlier, be execution in step 310 then, otherwise execution in step 310 '; In step 310, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, and judge whether success of inquiry, if successful inquiring then execution in step 311, the execution in step 320 if inquiry is unsuccessful; In step 311, the number of times that the one query of record is hit adds one, and execution in step 4 then; In step 320, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, and judge whether success of inquiry, if successful inquiring then execution in step 321, the execution in step 4 if inquiry is unsuccessful; In step 321, the number of times of secondary query hit of record is added one, execution in step 4 then; Step 310 ' in, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, and judge whether success of inquiry, if successful inquiring then execution in step 311 ', the execution in step 320 if inquiry is unsuccessful '; Step 311 ' in, the number of times that hits of one query of record is added one, execution in step 4 then; Step 320 ' in, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, and judges whether success of inquiry, the execution in step 4 if inquiry is unsuccessful, if successful inquiring then execution in step 321 '; Step 321 ' in, the number of times of secondary query hit of record is added one, execution in step 4 then; In step 4, judge whether to arrive the described statistics concluding time, be execution in step 6 then, otherwise execution in step 5; In step 5, judge whether new query requests, be execution in step 22 then, otherwise continue execution in step 5; In step 6,, determine described search order according to one query hit-count, secondary query hit number of times and the inquiry total degree of record.
In the above-mentioned specific embodiment five, described step 6 can specifically may further comprise the steps: in step 61, calculate according to following formula and once to hit success ratio and secondary hits success ratio:
Once hit success ratio=one query hit-count/inquiry total degree;
Secondary hits success ratio=secondary query hit number of times/inquiry total degree;
In step 62, whether the more described success ratio of once hitting hits success ratio greater than described secondary then, is execution in step 63 then, otherwise execution in step 64; In step 63, determine that described search order is search order last time, finish then; In step 64, in the exchange last time search order after the order of discrete data table and continuous data table as described search order, finish then.
In this specific embodiment five, after the data separating in the database is become discrete data and continuous data, inquire about respectively, thereby realize category submeter storage data, reduce index range scanning, increase the unique scanning of index; And determine search order by the automatic statistical analysis method, use statistical method to analyze success ratio first current search order under, and with this as judging whether rational foundation of current search order; Thereby reached following useful technique effect: improved the efficient of data query greatly, because the scale of data is very big in the application system, frequency of utilization is very high, answers the performance of this entire system also to be greatly improved; Highly versatile can satisfy most demands in the reality; Be simple and easy to use.
Below in conjunction with actual test data and test result, the technique effect of data enquire method of the present invention and data enquire method of the prior art is compared analysis.
Test environment is as follows:
Operating system: Windows 2000 Server+SP4
Hardware platform: common Dell PC (Intel P4 1.6GHz, 512M internal memory, 40G hard disk)
Database: Oracle Enterprise Edition 9.2.0.5
Method of testing one is data enquire method of the present invention, preserves discrete data and continuous data respectively.
The table configuration is as follows:
/ * creates table T_FEE_GROUPLIST0001 and preserves discrete data, and wherein the keeping records number is
229525, all be the discrete data * that generates at random/
create?table?T_FEE_GROUPLIST0001
(
BEGINNO?VARCHAR2(26)not?null,
ENDNO?VARCHAR2(26)
);
alter?table?T_FEE_GROUPLIST0001
add?constraint?PK_FEE_GROUPLIST0001?primary?key(BEGINNO)
using?index;
/ * creates table T_FEE_GROUPLISTSEG0001 and preserves continuous data, and wherein the keeping records number is
128, be the continuous data * that generates at random/
create?table?T_FEE_GROUPLISTSEG0001
(
BEGINNO?VARCHAR2(26)not?null,
ENDNO?VARCHAR2(26)not?null
);
alter?table?T_FEE_GROUPLIST0001
add?constraint?PK_FEE_GROUPLIST0001?primary?key(BEGINNO)
using?index;
The script configuration is as follows:
Carry out following script (wherein using current_timestamp to come start-of-record to carry out and finish to carry out the time of query manipulation):
SET?SERVEROUTPUT?ON;
DECLARE
v_UserNo?VARCHAR2(200);
v_Count?INT;
BEGIN
v_UserNo:=′aa02982559704′;
dbms_output.put_line(to_char(current_timestamp,
′yyyy-mm-dd?hh24:mi:ss:ff5′));
SELECT?COUNT(*)
INTO?v_Count
FROM?t_FEE_grouplist0001
WHERE?BeginNo=v_UserNo;
IF?v_Count=0?THEN
SELECT?COUNT(*)
INTO?v_Count
FROM?t_FEE_grouplistSeg0001
WHERE?BeginNo<=v_UserNo
AND?EndNo>=v_UserNo;
END?IF;
dbms_output.put_line(to_char(current_timestamp,
′yyyy-mm-dd?hh24:mi:ss:ff5′));
END;
Method of testing two is a data enquire method in the prior art, and all data mixing are kept in the table.
The table configuration is as follows:
/ * creates table T_COMPARE_GROUPLIST and preserves discrete data, and is just for what guarantee to test, and wherein keeping records directly imports from T_FEE_GROUPLIST0001 and T_FEE_GROUPLISTSEG0001, the consistent * of assurance test data/
create?table?T_COMPARE_GROUPLIST
(
BEGINNO?VARCHAR2(26)not?null,
ENDNO?VARCHAR2(26)not?null
);
alter?table?T_COMPARE_GROUPLIST
add?constraint?PK_T_COMPARE_GROUPLIST?primary?key
(BEGINNO,ENDNO)
using?index;
insert?into?t_COMPARE_GroupList?select?beginno,beginno?from
t_Fee_GroupList0001;
commit;
insert?into?t_COMPARE_GroupList?select?beginno,Endno?from
t_Fee_GroupListSeg0001;
commit;
The script configuration is as follows:
SET?SERVEROUTPUT?ON;
DECLARE
v_UserNo?VARCHAR2(200);
v_Count?INT;
BEGIN
v_UserNo:=′bb02982559704′;
dbms_output.put_line(to_char(current_times?tamp,
′yyyy-mm-dd?hh24:mi:ss:ff5′));
SELECT?COUNT(*)
INTO?v_Count
FROM?t_COMPARE_grouplist
WHERE?BeginNo<=v_UserNo
AND?EndNo>=v_User?No;
dbms_output.put_line(to_char(current_times?tamp,
′yyyy-mm-dd?hh24:mi:ss:ff5′));
END;
Method of testing one is that the test result of data enquire method of the present invention is as follows:
1, inquiry first (write down and be not buffered in the internal memory) is also found record (v_Count>0)
Start time: 2006-02-27 22:48:00:78600
Concluding time: 2006-02-27 22:48:00:80100
Carry out duration: 0.01500 second
2, non-inquiry (related data is buffered in the internal memory) and find (v_Count>0) first
Start time: 2006-02-27 22:48:03:78600
Concluding time: 2006-02-27 22:48:03:78600
Carry out duration: 0.00000 second
3, do not find record (v_Count=0), and do not have relevant buffered data in the internal memory
Start time: 2006-02-27 22:50:42:50100
Concluding time: 2006-02-27 22:50:42:51700
Carry out duration: 0.01600 second
4, do not find record (v_Count=0), and relevant buffered data is arranged in the internal memory
Start time: 2006-02-27 23:02:05:70700
Concluding time: 2006-02-27 23:02:05:70700
Carry out duration: 0.00000 second
Method of testing two is that the test result of data enquire method is as follows in the prior art:
1, inquiry first (write down and be not buffered in the internal memory) is also found record (v_Count>0)
Start time: 2006-02-27 22:54:17:63800
Concluding time: 2006-02-27 22:54:17:76300
Carry out duration: 0.12500 second
2, non-inquiry (related data is buffered in the internal memory) and find (v_Count>0) first
Start time: 2006-02-27 22:55:40:88600
Concluding time: 2006-02-27 22:55:40:88600
Carry out duration: 0.00000 second
3, do not find record (v_Count=0), and do not have relevant buffered data in the internal memory
Start time: 2006-02-27 22:57:25:94700
Concluding time: 2006-02-27 22:57:27:40000
Carry out duration: 1.45300 seconds
4, do not find record (v_Count=0), and relevant buffered data is arranged in the internal memory
Start time: 2006-02-27 23:00:00:44400
Concluding time: 2006-02-27 23:00:00:53800
Carry out duration: 0.09400 second
Contrast test method one and the execution duration of method of testing two under identical search condition, can find that the execution efficiency far of method of testing one under following three kinds of situations surpasses method of testing two:
(1) inquiry first (write down and be not buffered in the internal memory) is also found record (v_Count>0);
(2) do not find record (v_Count=0), and do not have relevant buffered data in the internal memory;
(3) do not find record (v_Count=0), and relevant buffered data is arranged in the internal memory.
And in non-inquiry (related data is buffered in the internal memory) first and find the efficient of two kinds of methods under the situation of (v_Count>0) suitable.
Therefore, by two kinds of method of testings are inquired about the test of qualified record quantity in database table, its test result has illustrated that fully data enquire method of the present invention can realize higher search efficiency.
Should be noted that at last: above embodiment is only in order to illustrate that technical scheme of the present invention is not intended to limit; Although with reference to preferred embodiment the present invention is had been described in detail, those of ordinary skill in the field are to be understood that: still can make amendment or the part technical characterictic is equal to replacement the specific embodiment of the present invention; And not breaking away from the spirit of technical solution of the present invention, it all should be encompassed in the middle of the technical scheme scope that the present invention asks for protection.

Claims (6)

1. a data enquire method is characterized in that, comprising:
Step 1, be the data separating in the database discrete data and continuous data, and leave in respectively in discrete data table and the continuous data table; Wherein, step 1 specifically comprises:
Step 11, extract a record in the described database, if extracts successfully then execution in step 12 gets nowhere then end if extract;
Whether step 12, the index initial data of judging described record and index end data equate; If equate then should write down the described discrete data table of insertion; If it is unequal then should write down and insert described continuous data table;
Step 13, judging whether the record in the described database has extracted, is execution in step 2 then, otherwise execution in step 11;
Step 2, determine the search order of described discrete data table and described continuous data table;
Step 3, carry out data query according to described search order.
2. method according to claim 1 is characterized in that, described step 3 specifically comprises:
Step 30, whether judging described search order for looking into the discrete data table earlier, is execution in step 31 then, otherwise execution in step 31 ';
Step 31, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, if successful inquiring then finish execution in step 32 if inquiry is unsuccessful;
Step 32, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, finish then;
Step 31 ', described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, if successful inquiring then finish, the execution in step 32 if inquiry is unsuccessful ';
Step 32 ', described discrete data table is carried out the unique index inquiry with the row of identification index initial data, finish then.
3. method according to claim 1 is characterized in that, also comprises between described step 2 and step 3:
Step 21, record statistical study project and current search order, and set statistics start time and statistics concluding time;
Step 22, the inquiry total degree that will write down add one.
4. method according to claim 3 is characterized in that, described step 3 specifically comprises:
Step 300, whether judging described search order for looking into the discrete data table earlier, is execution in step 310 then, otherwise execution in step 310 ';
Step 310, described discrete data table is carried out the unique index inquiry with the row of identification index initial data, and judge whether success of inquiry, if successful inquiring then execution in step 311, the execution in step 320 if inquiry is unsuccessful;
Step 311, the number of times that the one query of record is hit add one, finish then;
Step 320, described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, and judge whether success of inquiry, if successful inquiring then execution in step 321 finish if inquiry is unsuccessful;
Step 321, the number of times of secondary query hit of record is added one, finish then;
Step 310 ', described continuous data table is carried out the composite index inquiry with two row of identification index initial data and index end data, and judge whether inquiry is successful, if successful inquiring then execution in step 311 ', the execution in step 320 if inquiry is unsuccessful ';
Step 311 ', the number of times that hits of one query of record is added one, finish then;
Step 320 ', described discrete data table is carried out the unique index inquiry with the row of identification index initial data, and judge whether success of inquiry, finish if inquiry is unsuccessful, if successful inquiring then execution in step 321 ';
Step 321 ', the number of times of secondary query hit of record is added one, finish then.
5. method according to claim 4 is characterized in that, also comprises after the described step 3:
Step 4, judging whether to arrive the described statistics concluding time, is execution in step 6 then, otherwise execution in step 5;
Step 5, judge whether new query requests, be execution in step 22 then, otherwise continue execution in step 5;
Step 6, the one query hit-count according to record, secondary query hit number of times and inquiry total degree are determined described search order.
6. method according to claim 5 is characterized in that, described step 6 specifically comprises:
Step 61, calculate according to following formula and once to hit success ratio and secondary hits success ratio:
Once hit success ratio=one query hit-count/inquiry total degree;
Secondary hits success ratio=secondary query hit number of times/inquiry total degree;
Whether step 62, the more described success ratio of once hitting hit success ratio greater than described secondary, are execution in step 63 then, otherwise execution in step 64;
Step 63, determine that described search order is search order last time, finish then;
In step 64, the exchange last time search order after the order of discrete data table and continuous data table as described search order, finish then.
CNB2006100766143A 2006-04-19 2006-04-19 Data inquiry method Active CN100403314C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100766143A CN100403314C (en) 2006-04-19 2006-04-19 Data inquiry method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100766143A CN100403314C (en) 2006-04-19 2006-04-19 Data inquiry method

Publications (2)

Publication Number Publication Date
CN1967529A CN1967529A (en) 2007-05-23
CN100403314C true CN100403314C (en) 2008-07-16

Family

ID=38076302

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100766143A Active CN100403314C (en) 2006-04-19 2006-04-19 Data inquiry method

Country Status (1)

Country Link
CN (1) CN100403314C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636503A (en) * 2015-03-10 2015-05-20 浪潮集团有限公司 Method for querying data
CN109241094A (en) * 2017-07-10 2019-01-18 大唐移动通信设备有限公司 A kind of data query method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001067300A1 (en) * 2000-03-03 2001-09-13 Robert Fish Improved parameter-value databases
US20020059003A1 (en) * 2000-07-18 2002-05-16 Ruth Joseph D. System, method and computer program product for mapping data of multi-database origins
CN1581161A (en) * 2003-08-13 2005-02-16 华为技术有限公司 Method for realizing quick-accessing database
CN1592905A (en) * 2000-05-26 2005-03-09 计算机联合思想公司 System and method for automatically generating database queries

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001067300A1 (en) * 2000-03-03 2001-09-13 Robert Fish Improved parameter-value databases
CN1592905A (en) * 2000-05-26 2005-03-09 计算机联合思想公司 System and method for automatically generating database queries
US20020059003A1 (en) * 2000-07-18 2002-05-16 Ruth Joseph D. System, method and computer program product for mapping data of multi-database origins
CN1581161A (en) * 2003-08-13 2005-02-16 华为技术有限公司 Method for realizing quick-accessing database

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于概率统计及查询质量的数据源选择策略. 张春海,刘群,李华.计算机科学,第31卷第11期. 2004
基于概率统计及查询质量的数据源选择策略. 张春海,刘群,李华.计算机科学,第31卷第11期. 2004 *

Also Published As

Publication number Publication date
CN1967529A (en) 2007-05-23

Similar Documents

Publication Publication Date Title
CN109669934B (en) Data warehouse system suitable for electric power customer service and construction method thereof
CN102129442B (en) Distributed database system and data accessing method
Hammer et al. A heuristic approach to attribute partitioning
AU730251B2 (en) Cardinality-based join ordering
US7743015B2 (en) Data processing systems and methods
US6446063B1 (en) Method, system, and program for performing a join operation on a multi column table and satellite tables
US7593931B2 (en) Apparatus, system, and method for performing fast approximate computation of statistics on query expressions
US8914354B2 (en) Cardinality and selectivity estimation using a single table join index
CN102214176B (en) Method for splitting and join of huge dimension table
CN101344893B (en) History data access method and apparatus
US20080140627A1 (en) Method and apparatus for aggregating database runtime information and analyzing application performance
CN108376143A (en) A kind of novel OLAP precomputations model and the method for generating precomputation result
CN107025242A (en) The clone method and device of data between database
CN104239377A (en) Platform-crossing data retrieval method and device
CN101790257A (en) Method for memorizing data and network management system
Hu et al. Indexing techniques for wireless data broadcast under data clustering and scheduling
Balfe et al. An analysis of query similarity in collaborative web search
CN113987002A (en) Data exchange method based on mass data analysis platform
CN100403314C (en) Data inquiry method
CN111078794A (en) Big data storage system
CN105653654A (en) Lucky draw qualification indexing system and method
CN105446824A (en) Table increment obtaining method and remote data backup method
CN106383897A (en) Database capacity calculation method and apparatus
CN101237348B (en) A realization method for simple network management protocol queue
Ozsoyoglu et al. On estimating COUNT, SUM, and AVERAGE relational algebra queries

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