CN104714972B - Database divides table foundation and querying method - Google Patents
Database divides table foundation and querying method Download PDFInfo
- Publication number
- CN104714972B CN104714972B CN201310691309.5A CN201310691309A CN104714972B CN 104714972 B CN104714972 B CN 104714972B CN 201310691309 A CN201310691309 A CN 201310691309A CN 104714972 B CN104714972 B CN 104714972B
- Authority
- CN
- China
- Prior art keywords
- retrieval
- sentence
- database
- key assignments
- actually
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention proposes database and divides table foundation and querying method, the method includes:Divide table key assignments that the data record summary table in database is cut into a component table based on setting;Divide table key value mapping table that the original retrieval sentence from applications is converted at least one retrieval sentence that actually can perform based on retrieval parameter;Search operaqtion is performed, and retrieval result is sent back the applications based at least one retrieval sentence that actually can perform.Database disclosed in this invention divides table foundation and querying method is capable of providing unified query interface and with high search efficiency and low cost.
Description
Technical field
The present invention relates to databases to divide table foundation and querying method, more particularly, to based on the database for dividing table key assignments
Divide table foundation and querying method.
Background technology
At present, becoming increasingly abundant with increasingly extensive and different field the type of business of computer and networks application,
A point table is carried out to the data-base recording summary table comprising mass data(Summary table will be recorded and be cut into one group of son according to the rule of setting
Table, each sublist reflect a part for the record summary table)And then become increasingly to weigh for each point of table progress inquiry operation
It will.
In existing technical solution, each applications are respectively provided with for the different specific inquiries for dividing table and developing
Module, and pass through the enquiry module and table is divided to carry out inquiry operation different.
However, there are the following problems for existing technical solution:Since each applications need table to be divided to open for different
Send out enquiry module specific(Specifically inquire code), therefore development and maintenance cost is higher, and divides table due to being directed to difference
Inquiry operation otherness, total search efficiency is lowered.
Accordingly, there exist following demands:There is provided has high search efficiency and low cost based on unified query interface
Database divides table foundation and querying method.
Invention content
In order to solve the problems existing in the prior art scheme, the present invention proposes the tool based on unified query interface
There are high search efficiency and the database of low cost to divide table foundation and querying method.
The purpose of the present invention is what is be achieved through the following technical solutions:
A kind of database divides table foundation and querying method, and the database divides table foundation and querying method to include following step
Suddenly:
(A1)Divide table key assignments that the data record summary table in database is cut into a component table based on setting, wherein, institute
State the value that point table key assignments refers to the particular column in the data record of the database, the difference of the value based on the particular column, each
Data record is divided into different divide in table;
(A2)Based on retrieval parameter-table key value mapping table is divided to be converted into the original retrieval sentence from applications at least
One retrieval sentence that actually can perform, wherein, the retrieval parameter-table key value mapping table is divided to define the original retrieval sentence
In retrieval parameter and the mapping relations divided between table key assignments;
(A3)Search operaqtion is performed, and retrieval result is transmitted based at least one retrieval sentence that actually can perform
Return the applications.
In scheme disclosed above, it is preferable that the step(A2)Further comprise:When from the applications
Original retrieval sentence in retrieval parameter include described when dividing table key assignments, divide table key assignments will be in the retrieval parameter based on described
Logic table name be converted to physics table name, and original retrieval sentence is converted into for the object according to the physical table star
Manage at least one retrieval sentence that actually can perform of the physical table representated by table name.
In scheme disclosed above, it is preferable that the step(A2)Further comprise:When from the applications
Original retrieval sentence in retrieval parameter do not include it is described when dividing table key assignments, based on the retrieval parameter-table key assignments is divided to map
Table by the value of the specific fields in the retrieval parameter be mapped to it is one or more it is different divide table key assignments, therewith based on described point
Logic table name in the retrieval parameter is converted to physics table name, and the original inspection according to the physical table star by table key assignments
Rope sentence is converted at least one retrieval sentence that actually can perform for the physical table representated by the physics table name.
In scheme disclosed above, it is preferable that the value of the specific fields in the retrieval parameter is mapped to more
It is a it is different divide table key assignments in the case of, the plurality of different point of table key assignments is endowed different preferential according to pre-defined rule
Grade.
In scheme disclosed above, it is preferable that when at least one retrieval sentence that actually can perform is multiple
Actually during executable retrieval sentence, each in the multiple actually executable retrieval sentence is endowed according to pre-defined rule
Different priority.
In scheme disclosed above, it is preferable that the retrieval sentence is the retrieval language based on structured query language
Sentence.
In scheme disclosed above, it is preferable that the step(A3)Further comprise as follows based on described
At least one retrieval sentence that actually can perform performs search operaqtion:(1)In the case where requiring relatively low scene to query time, by institute
It states at least one retrieval sentence that actually can perform and is spliced into a retrieval sentence, and submit it database therewith and once hold
Row;(2)Under the scene more demanding to query time, according to the preferential of at least one retrieval sentence that actually can perform
The retrieval sentence of highest priority is first carried out in grade, and if retrieval result is not sky, does not perform subsequent retrieval sentence,
Otherwise, the remaining retrieval sentence that actually can perform is spliced into a retrieval sentence, and submits it database one therewith
Secondary execution.
Database disclosed in this invention divides table foundation and querying method to has the following advantages:(1)Due to the use of retrieval
Parameter-divide table key value mapping table, therefore the unified query interface for dividing table for difference can be provided to different applications, so as to
It is easy to maintain and reduce cost;(2)Implement different search operaqtions since different scenes can be directed to, therefore can be significantly
Improve recall precision.
Description of the drawings
With reference to attached drawing, technical characteristic of the invention and advantage will be more fully understood by those skilled in the art, wherein:
Fig. 1 is the flow chart that database according to an embodiment of the invention divides table foundation and querying method.
Specific embodiment
Fig. 1 is the flow chart that database according to an embodiment of the invention divides table foundation and querying method.As shown in Figure 1,
Database disclosed in this invention divides table foundation and querying method to include the following steps:(A1)Divide table key assignments by number based on setting
A component table is cut into according to the data record summary table in library, wherein, the data record that table key assignments is divided to refer to the database
In particular column value, the difference of the value based on the particular column, each data record is divided into different divide in table(For example,
It for the value C of a certain row in data record, is matched according to some specific rule, if certain records C fields
Value meets condition A, then is saved in A tables;If the value of the C fields of certain record meets condition B, B tables are saved in, then " field
The value of C " is referred to as a point table key assignments);(A2)Based on retrieval parameter-divide table key value mapping table by the original retrieval from applications
Sentence is converted at least one retrieval sentence that actually can perform, wherein, the retrieval parameter-table key value mapping table is divided to define institute
State the retrieval parameter in original retrieval sentence and the mapping relations divided between table key assignments;(A3)Based at least one reality
The retrieval sentence that border can perform performs search operaqtion, and retrieval result is sent back the applications.
Preferably, divide in table foundation and querying method in database disclosed in this invention, the step(A2)Further
Including:When the retrieval parameter in the original retrieval sentence from the applications divides table key assignments including described in, based on described
Table key assignments is divided the logic table name in the retrieval parameter to be converted to physics table name, and original according to the physical table star
Retrieval sentence is converted at least one retrieval sentence that actually can perform for the physical table representated by the physics table name.
Preferably, divide in table foundation and querying method in database disclosed in this invention, the step(A2)Further
Including:When the retrieval parameter in the original retrieval sentence from the applications does not divide table key assignments including described in, based on institute
State retrieval parameter-divide table key value mapping table the value of the specific fields in the retrieval parameter is mapped to it is one or more different
Divide table key assignments(For example, in financial field, many original query statements are joined by retrieval of date of settlement in batch subsystem
What number was write, therefore, by taking date of settlement as an example, date of settlement is with dividing table key assignments(Such as the external transaction date)Mapping close
System can realize as follows:One date of settlement T can match 4 external transaction dates(T-2, T-1, T, T+1),
Its practical business meaning is:The day of continuous 4 days is in table, is likely to that there are the transaction journal data that date of settlement is (T)),
Divide table key assignments that the logic table name in the retrieval parameter is converted to physics table name, and according to the physical table based on described therewith
Original retrieval sentence is converted into can perform at least one reality of the physical table representated by the physics table name described in star
Retrieval sentence.
Preferably, divide in table foundation and querying method in database disclosed in this invention, in the retrieval parameter
The value of specific fields be mapped to it is multiple and different divide table key assignments in the case of, the plurality of different point of table key assignments is according to predetermined
Rule is endowed different priority(For example, in financial field, due to for the transaction of most date of settlement T,
The external transaction date is all T, if so retrieving the friendship that date of settlement is T first from the physical table that the external transaction date is T
Easy data, then hit rate can higher).
Preferably, divide in table foundation and querying method in database disclosed in this invention, when at least one reality
When executable retrieval sentence is multiple actually executable retrieval sentences, in the multiple actually executable retrieval sentence
Different priority is each endowed according to pre-defined rule(For example, in retrieval parameter D=V1 of original retrieval sentence, reflected
It is [V1, V1+1, V1-1, V1-2] to be mapped to as the value for the C fields for dividing table key assignments, this 4 values are endowed different priority,
Position C=V1 of highest priority, is meant that:The data of most of D=V1, all eligible C=V1, i.e., if being by condition
The retrieval sentence of " D=V1 " is converted into the retrieval sentence with " D=V1 and C=V1 " condition, then can retrieve most
Target data).
Illustratively, divide in table foundation and querying method in database disclosed in this invention, the retrieval sentence is base
In structured query language(SQL)Retrieval sentence.
Preferably, divide in table foundation and querying method in database disclosed in this invention, the step(A3)Further
Including performing search operaqtion based at least one retrieval sentence that actually can perform as follows:(1)When to inquiry
Between require under relatively low scene, at least one actually executable retrieval sentence is spliced into a retrieval sentence(Such as
Use the Union All tools in SQL), and submit it database therewith and once perform;(2)It is required to query time
Under higher scene, highest priority is first carried out according to the priority of at least one retrieval sentence that actually can perform
Sentence is retrieved, and if retrieval result is not sky, does not perform subsequent retrieval sentence, otherwise, remaining reality can be held
Capable retrieval sentence is spliced into a retrieval sentence(Such as use the Union All tools in SQL), and submit it therewith
Database once performs(Because the hit rate of the high retrieval sentence of priority is very high, therefore the retrieval of highest priority is first carried out
Sentence can significantly increase recall precision).
Therefore database disclosed in this invention divides table foundation and querying method to have following advantages:(1)Due to making
With retrieval parameter-divide table key value mapping table, therefore the unified queries that divide table for difference can be provided to different applications
Interface, so as to easy to maintain and reduce cost;(2)Implement different search operaqtions since different scenes can be directed to, therefore
Recall precision can be significantly increased.
Although the present invention is described by above-mentioned preferred embodiment, way of realization is not limited to
Above-mentioned embodiment.It should be realized that:In the case where not departing from spirit and scope of the present invention, those skilled in the art can be with
Different change and modification are made to the present invention.
Claims (4)
1. a kind of database divides, table is established and querying method, the database divide table foundation and querying method to include the following steps:
(A1)Divide table key assignments that the data record summary table in database is cut into a component table based on setting, wherein, described point
Table key assignments refers to the value of the particular column in the data record of the database, the difference of the value based on the particular column, each data
Record is divided into different divide in table;
(A2)Based on retrieval parameter-that table key value mapping table is divided to be converted into the original retrieval sentence from applications is at least one
Actually executable retrieval sentence, wherein, the retrieval parameter-table key value mapping table is divided to define in the original retrieval sentence
Retrieval parameter and the mapping relations divided between table key assignments;
(A3)Search operaqtion is performed, and retrieval result is sent back institute based at least one retrieval sentence that actually can perform
State applications;
Wherein, the step(A2)Further comprise:
When the retrieval parameter in the original retrieval sentence from the applications divides table key assignments including described in, based on described point
Logic table name in the retrieval parameter is converted to physics table name, and the original inspection according to the physical table star by table key assignments
Rope sentence is converted at least one retrieval sentence that actually can perform for the physical table representated by the physics table name;With
When the retrieval parameter in the original retrieval sentence from the applications does not divide table key assignments including described in, based on described
Retrieval parameter-divide table key value mapping table that the value of the specific fields in the retrieval parameter is mapped to one or more different points
Table key assignments divides table key assignments that the logic table name in the retrieval parameter is converted to physics table name, and according to institute based on described therewith
It states original retrieval sentence described in physical table star and is converted at least one reality for the physical table representated by the physics table name
The retrieval sentence that border can perform;
Wherein, the step(A3)Including performing inspection based at least one retrieval sentence that actually can perform as follows
Rope operates:(1)In the case where requiring relatively low scene to query time, at least one retrieval sentence that actually can perform is spliced
Into a retrieval sentence, and database is submitted it therewith and is once performed;(2)In the scene more demanding to query time
Under, the retrieval sentence of highest priority is first carried out according to the priority of at least one actually executable retrieval sentence,
And if retrieval result is not sky, subsequent retrieval sentence is not performed, otherwise, by the remaining retrieval language that actually can perform
Sentence is spliced into a retrieval sentence, and submits it database therewith and once perform.
2. database according to claim 1 divides table foundation and querying method, which is characterized in that in the retrieval parameter
Specific fields value be mapped to it is multiple and different divide table key assignments in the case of, the plurality of different point of table key assignments is according to pre-
Set pattern is then endowed different priority.
3. database according to claim 1 divides table foundation and querying method, which is characterized in that when at least one reality
When the retrieval sentence that border can perform is multiple actually executable retrieval sentences, in the multiple actually executable retrieval sentence
Each different priority is endowed according to pre-defined rule.
4. database according to claim 1 divides table foundation and querying method, which is characterized in that the retrieval sentence is base
In the retrieval sentence of structured query language.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310691309.5A CN104714972B (en) | 2013-12-17 | 2013-12-17 | Database divides table foundation and querying method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310691309.5A CN104714972B (en) | 2013-12-17 | 2013-12-17 | Database divides table foundation and querying method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104714972A CN104714972A (en) | 2015-06-17 |
CN104714972B true CN104714972B (en) | 2018-06-22 |
Family
ID=53414315
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310691309.5A Active CN104714972B (en) | 2013-12-17 | 2013-12-17 | Database divides table foundation and querying method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104714972B (en) |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106933842B (en) * | 2015-12-29 | 2020-09-22 | 阿里巴巴集团控股有限公司 | Database query method and device |
TW201734771A (en) * | 2016-03-31 | 2017-10-01 | Samoa Datastream Iot Tech Co Ltd Taiwan Branch | Seamless metric logic operation system and operation method thereof increasing the visibility of metric items, improving the re-use rate of the parameters in the metric items, and reducing the cost and time efficiencies in developing programs |
CN107305554A (en) * | 2016-04-20 | 2017-10-31 | 泰康保险集团股份有限公司 | Data query processing method and processing device |
CN106326333A (en) * | 2016-07-05 | 2017-01-11 | 蓝盾信息安全技术有限公司 | Network audit system database dynamic sublist method and device |
CN106649435A (en) * | 2016-09-07 | 2017-05-10 | 努比亚技术有限公司 | Data query device and method of querying data |
CN108021588B (en) * | 2016-10-28 | 2021-05-25 | 北京京东尚科信息技术有限公司 | Integration method and device for user first purchase data facing electronic commerce |
CN106547870B (en) * | 2016-10-31 | 2020-03-17 | 天脉聚源(北京)科技有限公司 | Method and device for dividing tables of database |
CN107609093B (en) * | 2017-09-08 | 2020-12-18 | 东软集团股份有限公司 | Database table monitoring method, device, equipment and storage medium |
CN109697068A (en) * | 2017-10-24 | 2019-04-30 | 中移(苏州)软件技术有限公司 | One kind dividing logic SQL statement interpretation method and device under the table mode of library |
CN110109919B (en) * | 2018-02-02 | 2024-01-12 | 北京京东尚科信息技术有限公司 | Method and device for determining logic information |
CN108763381B (en) * | 2018-05-18 | 2022-05-17 | 土巴兔集团股份有限公司 | Table dividing method and device based on consistent Hash algorithm |
CN110727702B (en) * | 2019-09-16 | 2024-01-26 | 平安科技(深圳)有限公司 | Data query method, device, terminal and computer readable storage medium |
CN112699115A (en) * | 2019-10-23 | 2021-04-23 | 拉扎斯网络科技(上海)有限公司 | Data storage and query method and device, electronic equipment and storage medium |
CN111125114B (en) * | 2019-12-25 | 2023-06-16 | 中国建设银行股份有限公司 | Method and device for laterally expanding database and accessing data table |
CN111881323B (en) * | 2020-06-19 | 2022-05-20 | 四川新网银行股份有限公司 | Table separation method based on sequencing field and time routing |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101876983A (en) * | 2009-04-30 | 2010-11-03 | 国际商业机器公司 | Method for partitioning database and system thereof |
CN102426602A (en) * | 2010-10-28 | 2012-04-25 | 微软公司 | Scoped database connections |
CN102890714A (en) * | 2012-09-24 | 2013-01-23 | 华为技术有限公司 | Method and device for indexing data |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7596560B2 (en) * | 2004-12-23 | 2009-09-29 | Raytheon Company | System and method for adaptive query identification and acceleration |
-
2013
- 2013-12-17 CN CN201310691309.5A patent/CN104714972B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101876983A (en) * | 2009-04-30 | 2010-11-03 | 国际商业机器公司 | Method for partitioning database and system thereof |
CN102426602A (en) * | 2010-10-28 | 2012-04-25 | 微软公司 | Scoped database connections |
CN102890714A (en) * | 2012-09-24 | 2013-01-23 | 华为技术有限公司 | Method and device for indexing data |
Non-Patent Citations (1)
Title |
---|
云计算环境下大规模数据存储技术研究;王培建;《中国优秀硕士学位论文全文数据库 信息科技辑》;20131115(第11期);I137-26 * |
Also Published As
Publication number | Publication date |
---|---|
CN104714972A (en) | 2015-06-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104714972B (en) | Database divides table foundation and querying method | |
CN108874971B (en) | Tool and method applied to mass tagged entity data storage | |
CN110321344B (en) | Information query method and device for associated data, computer equipment and storage medium | |
JP6388655B2 (en) | Generation of multi-column index of relational database by data bit interleaving for selectivity | |
CA2562281C (en) | Partial query caching | |
US7774379B2 (en) | Methods for partitioning an object | |
US9087105B2 (en) | Rule-based extraction, transformation, and loading of data between disparate data sources | |
US10922316B2 (en) | Using computing resources to perform database queries according to a dynamically determined query size | |
US20150106352A1 (en) | Aggregation of data from disparate sources into an efficiently accessible format | |
CN101206670B (en) | System and method for transferring non construction information to content | |
CN104462430B (en) | The data processing method and device of relevant database | |
CN107491487A (en) | A kind of full-text database framework and bitmap index establishment, data query method, server and medium | |
TW201415262A (en) | Construction of inverted index system, data processing method and device based on Lucene | |
CN104112008A (en) | Multi-table data association inquiry optimizing method and device | |
CN105447051A (en) | Database operation method and device | |
US20060235820A1 (en) | Relational query of a hierarchical database | |
CN103823846A (en) | Method for storing and querying big data on basis of graph theories | |
US20200226116A1 (en) | Fast index creation system for cloud big data database | |
US10482087B2 (en) | Storage system and method of operating the same | |
WO2017107130A1 (en) | Data query method and database system | |
CN102750384A (en) | Device and method for acquiring data from multidatabase engine | |
CN101963993B (en) | Method for fast searching database sheet table record | |
US9984108B2 (en) | Database joins using uncertain criteria | |
CN106991116B (en) | Optimization method and device for database execution plan | |
US8606744B1 (en) | Parallel transfer of data from one or more external sources into a database 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |